this.actor = new St.Button({ text: "This is a button" });
this.actor._delegate = this;
- this.actor.connect('clicked', Lang.bind(this, this._onClicked));
+ this.actor.connect('clicked', this._onClicked.bind(this));
},
_onClicked(actor) {
is a keyword with a value passed in at function invocation time, it is not a
variable that can be captured in closures.
-All closures should be wrapped with a Lang.bind.
+All closures should be wrapped with Function.prototype.bind or use arrow
+notation.
const Lang = imports.lang;
- let closure = Lang.bind(this, function() { this._fnorbate(); });
+ let closure1 = () => { this._fnorbate(); };
+ let closure2 = this._fnorbate.bind(this);
A more realistic example would be connecting to a signal on a method of a
prototype:
var MyClass = new Lang.Class({
_init() {
let fnorb = new FnorbLib.Fnorb();
- fnorb.connect('frobate', Lang.bind(this, this._onFnorbFrobate));
+ fnorb.connect('frobate', this._onFnorbFrobate.bind(this));
},
_onFnorbFrobate(fnorb) {
flags: Gio.ApplicationFlags.HANDLES_COMMAND_LINE
});
- this.application.connect('activate', Lang.bind(this, this._onActivate));
- this.application.connect('command-line', Lang.bind(this, this._onCommandLine));
- this.application.connect('startup', Lang.bind(this, this._onStartup));
+ this.application.connect('activate', this._onActivate.bind(this));
+ this.application.connect('command-line', this._onCommandLine.bind(this));
+ this.application.connect('startup', this._onStartup.bind(this));
this._extensionPrefsModules = {};
this._window.add(scroll);
this._extensionSelector = new Gtk.ListBox({ selection_mode: Gtk.SelectionMode.NONE });
- this._extensionSelector.set_sort_func(Lang.bind(this, this._sortList));
- this._extensionSelector.set_header_func(Lang.bind(this, this._updateHeader));
+ this._extensionSelector.set_sort_func(this._sortList.bind(this));
+ this._extensionSelector.set_header_func(this._updateHeader.bind(this));
scroll.add(this._extensionSelector);
_scanExtensions() {
let finder = new ExtensionUtils.ExtensionFinder();
- finder.connect('extension-found', Lang.bind(this, this._extensionFound));
+ finder.connect('extension-found', this._extensionFound.bind(this));
finder.scanExtensions();
this._extensionsLoaded();
},
this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly: reauthenticationOnly });
- this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
- this._userVerifier.connect('show-message', Lang.bind(this, this._onShowMessage));
- this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
- this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
- this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
- this._userVerifier.connect('smartcard-status-changed', Lang.bind(this, this._onSmartcardStatusChanged));
- this._userVerifier.connect('ovirt-user-authenticated', Lang.bind(this, this._onOVirtUserAuthenticated));
+ this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
+ this._userVerifier.connect('show-message', this._onShowMessage.bind(this));
+ this._userVerifier.connect('verification-failed', this._onVerificationFailed.bind(this));
+ this._userVerifier.connect('verification-complete', this._onVerificationComplete.bind(this));
+ this._userVerifier.connect('reset', this._onReset.bind(this));
+ this._userVerifier.connect('smartcard-status-changed', this._onSmartcardStatusChanged.bind(this));
+ this._userVerifier.connect('ovirt-user-authenticated', this._onOVirtUserAuthenticated.bind(this));
this.smartcardDetected = this._userVerifier.smartcardDetected;
this.connect('next', () => {
this.actor = new St.BoxLayout({ style_class: 'login-dialog-prompt-layout',
vertical: true });
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('key-press-event', (actor, event) => {
if (event.get_key_symbol() == Clutter.KEY_Escape)
this.cancel();
_init(user) {
this.user = user;
this._userChangedId = this.user.connect('changed',
- Lang.bind(this, this._onUserChanged));
+ this._onUserChanged.bind(this));
let layout = new St.BoxLayout({ vertical: true });
this.actor = new St.Button({ style_class: 'login-dialog-user-list-item',
reactive: true,
x_align: St.Align.START,
x_fill: true });
- this.actor.connect('destroy',
- Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('key-focus-in', () => {
this._setSelected(true);
scale_x: 0 });
layout.add(this._timedLoginIndicator);
- this.actor.connect('clicked', Lang.bind(this, this._onClicked));
+ this.actor.connect('clicked', this._onClicked.bind(this));
this._onUserChanged();
},
this.actor.add_actor(this._box);
this._items = {};
- this.actor.connect('key-focus-in', Lang.bind(this, this._moveFocusToItems));
+ this.actor.connect('key-focus-in', this._moveFocusToItems.bind(this));
},
_moveFocusToItems() {
this._items[userName] = item;
- item.connect('activate',
- Lang.bind(this, this._onItemActivated));
+ item.connect('activate', this._onItemActivated.bind(this));
// Try to keep the focused item front-and-center
item.actor.connect('key-focus-in', () => { this.scrollToItem(item); });
this.actor.get_accessible().set_role(Atk.Role.WINDOW);
this.actor.add_constraint(new Layout.MonitorConstraint({ primary: true }));
- this.actor.connect('allocate', Lang.bind(this, this._onAllocate));
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('allocate', this._onAllocate.bind(this));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
parentActor.add_child(this.actor);
this._userManager = AccountsService.UserManager.get_default()
this._settings = new Gio.Settings({ schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_KEY,
- Lang.bind(this, this._updateBanner));
+ this._updateBanner.bind(this));
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_TEXT_KEY,
- Lang.bind(this, this._updateBanner));
+ this._updateBanner.bind(this));
this._settings.connect('changed::' + GdmUtil.DISABLE_USER_LIST_KEY,
- Lang.bind(this, this._updateDisableUserList));
+ this._updateDisableUserList.bind(this));
this._settings.connect('changed::' + GdmUtil.LOGO_KEY,
- Lang.bind(this, this._updateLogo));
+ this._updateLogo.bind(this));
this._textureCache = St.TextureCache.get_default();
this._updateLogoTextureId = this._textureCache.connect('texture-file-changed',
- Lang.bind(this, this._updateLogoTexture));
+ this._updateLogoTexture.bind(this));
this._userSelectionBox = new St.BoxLayout({ style_class: 'login-dialog-user-selection-box',
x_align: Clutter.ActorAlign.CENTER,
y_fill: true });
this._authPrompt = new AuthPrompt.AuthPrompt(this._gdmClient, AuthPrompt.AuthPromptMode.UNLOCK_OR_LOG_IN);
- this._authPrompt.connect('prompted', Lang.bind(this, this._onPrompted));
- this._authPrompt.connect('reset', Lang.bind(this, this._onReset));
+ this._authPrompt.connect('prompted', this._onPrompted.bind(this));
+ this._authPrompt.connect('reset', this._onReset.bind(this));
this._authPrompt.hide();
this.actor.add_child(this._authPrompt.actor);
x_align: St.Align.START,
x_fill: true });
- this._notListedButton.connect('clicked', Lang.bind(this, this._hideUserListAskForUsernameAndBeginVerification));
+ this._notListedButton.connect('clicked', this._hideUserListAskForUsernameAndBeginVerification.bind(this));
this._notListedButton.hide();
this._realmManager = new Realmd.Manager();
this._realmSignalId = this._realmManager.connect('login-format-changed',
- Lang.bind(this, this._showRealmLoginHint));
+ this._showRealmLoginHint.bind(this));
- LoginManager.getLoginManager().getCurrentSessionProxy(Lang.bind(this, this._gotGreeterSessionProxy));
+ LoginManager.getLoginManager().getCurrentSessionProxy(this._gotGreeterSessionProxy.bind(this));
// If the user list is enabled, it should take key focus; make sure the
// screen shield is initialized first to prevent it from stealing the
// focus later
this._startupCompleteId = Main.layoutManager.connect('startup-complete',
- Lang.bind(this, this._updateDisableUserList));
+ this._updateDisableUserList.bind(this));
},
_getBannerAllocation(dialogBox) {
}
});
} else {
- let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, this._loadUserList));
+ let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, this._loadUserList.bind(this));
GLib.Source.set_name_by_id(id, '[gnome-shell] _loadUserList');
}
},
this._greeter = this._gdmClient.get_greeter_sync(null);
this._defaultSessionChangedId = this._greeter.connect('default-session-name-changed',
- Lang.bind(this, this._onDefaultSessionChanged));
+ this._onDefaultSessionChanged.bind(this));
this._sessionOpenedId = this._greeter.connect('session-opened',
- Lang.bind(this, this._onSessionOpened));
+ this._onSessionOpened.bind(this));
this._timedLoginRequestedId = this._greeter.connect('timed-login-requested',
- Lang.bind(this, this._onTimedLoginRequested));
+ this._onTimedLoginRequested.bind(this));
}
},
this._credentials = new OVirtCredentials();
this._credentials.connectSignal('UserAuthenticated',
- Lang.bind(this, this._onUserAuthenticated));
+ this._onUserAuthenticated.bind(this));
},
_onUserAuthenticated(proxy, sender, [token]) {
this._aggregateProvider = Provider(Gio.DBus.system,
'org.freedesktop.realmd',
'/org/freedesktop/realmd',
- Lang.bind(this, this._reloadRealms))
+ this._reloadRealms.bind(this))
this._realms = {};
this._signalId = this._aggregateProvider.connect('g-properties-changed',
let realm = Realm(Gio.DBus.system,
'org.freedesktop.realmd',
realmPaths[i],
- Lang.bind(this, this._onRealmLoaded));
+ this._onRealmLoaded.bind(this));
}
},
this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed',
- Lang.bind(this, this._updateDefaultService));
+ this._updateDefaultService.bind(this));
this._updateDefaultService();
this._fprintManager = Fprint.FprintManager();
this._checkForSmartcard();
this._smartcardInsertedId = this._smartcardManager.connect('smartcard-inserted',
- Lang.bind(this, this._checkForSmartcard));
+ this._checkForSmartcard.bind(this));
this._smartcardRemovedId = this._smartcardManager.connect('smartcard-removed',
- Lang.bind(this, this._checkForSmartcard));
+ this._checkForSmartcard.bind(this));
this._messageQueue = [];
this._messageQueueTimeoutId = 0;
this._oVirtUserAuthenticated(this._oVirtCredentialsManager.getToken());
this._oVirtUserAuthenticatedId = this._oVirtCredentialsManager.connect('user-authenticated',
- Lang.bind(this, this._oVirtUserAuthenticated));
+ this._oVirtUserAuthenticated.bind(this));
},
begin(userName, hold) {
// If possible, reauthenticate an already running session,
// so any session specific credentials get updated appropriately
this._client.open_reauthentication_channel(userName, this._cancellable,
- Lang.bind(this, this._reauthenticationChannelOpened));
+ this._reauthenticationChannelOpened.bind(this));
} else {
- this._client.get_user_verifier(this._cancellable, Lang.bind(this, this._userVerifierGot));
+ this._client.get_user_verifier(this._cancellable, this._userVerifierGot.bind(this));
}
},
// Gdm emits org.freedesktop.DBus.Error.AccessDenied when there is
// no session to reauthenticate. Fall back to performing verification
// from this login session
- client.get_user_verifier(this._cancellable, Lang.bind(this, this._userVerifierGot));
+ client.get_user_verifier(this._cancellable, this._userVerifierGot.bind(this));
return;
} catch(e) {
this._reportInitError('Failed to open reauthentication channel', e);
},
_connectSignals() {
- this._userVerifier.connect('info', Lang.bind(this, this._onInfo));
- this._userVerifier.connect('problem', Lang.bind(this, this._onProblem));
- this._userVerifier.connect('info-query', Lang.bind(this, this._onInfoQuery));
- this._userVerifier.connect('secret-info-query', Lang.bind(this, this._onSecretInfoQuery));
- this._userVerifier.connect('conversation-stopped', Lang.bind(this, this._onConversationStopped));
- this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
- this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
+ this._userVerifier.connect('info', this._onInfo.bind(this));
+ this._userVerifier.connect('problem', this._onProblem.bind(this));
+ this._userVerifier.connect('info-query', this._onInfoQuery.bind(this));
+ this._userVerifier.connect('secret-info-query', this._onSecretInfoQuery.bind(this));
+ this._userVerifier.connect('conversation-stopped', this._onConversationStopped.bind(this));
+ this._userVerifier.connect('reset', this._onReset.bind(this));
+ this._userVerifier.connect('verification-complete', this._onVerificationComplete.bind(this));
},
_getForegroundService() {
scanExtensions() {
let perUserDir = Gio.File.new_for_path(global.userdatadir);
- FileUtils.collectFromDatadirs('extensions', true, Lang.bind(this, this._loadExtension, perUserDir));
+ FileUtils.collectFromDatadirs('extensions', true, (dir, info) => {
+ this._loadExtension(dir, info, perUserDir);
+ });
}
});
Signals.addSignalMethods(ExtensionFinder.prototype);
if (this._key) {
this._history = global.settings.get_strv(this._key);
global.settings.connect('changed::' + this._key,
- Lang.bind(this, this._historyChanged));
+ this._historyChanged.bind(this));
} else {
this._history = [];
if (this._entry) {
this._entry.connect('key-press-event',
- Lang.bind(this, this._onEntryKeyPress));
+ this._onEntryKeyPress.bind(this));
}
},
this._preloadEnginesId = 0;
this._ibus = IBus.Bus.new_async();
- this._ibus.connect('connected', Lang.bind(this, this._onConnected));
- this._ibus.connect('disconnected', Lang.bind(this, this._clear));
+ this._ibus.connect('connected', this._onConnected.bind(this));
+ this._ibus.connect('disconnected', this._clear.bind(this));
// Need to set this to get 'global-engine-changed' emitions
this._ibus.set_watch_ibus_signal(true);
- this._ibus.connect('global-engine-changed', Lang.bind(this, this._engineChanged));
+ this._ibus.connect('global-engine-changed', this._engineChanged.bind(this));
this._spawn();
},
},
_onConnected() {
- this._ibus.list_engines_async(-1, null, Lang.bind(this, this._initEngines));
+ this._ibus.list_engines_async(-1, null, this._initEngines.bind(this));
this._ibus.request_name_async(IBus.SERVICE_PANEL,
IBus.BusNameFlag.REPLACE_EXISTING,
-1, null,
- Lang.bind(this, this._initPanelService));
+ this._initPanelService.bind(this));
},
_initEngines(ibus, result) {
this._panelService = new IBus.PanelService({ connection: this._ibus.get_connection(),
object_path: IBus.PATH_PANEL });
this._candidatePopup.setPanelService(this._panelService);
- this._panelService.connect('update-property', Lang.bind(this, this._updateProperty));
+ this._panelService.connect('update-property', this._updateProperty.bind(this));
try {
// IBus versions older than 1.5.10 have a bug which
// causes spurious set-content-type emissions when
// and hints defeating its intended semantics and
// confusing users. We thus don't use it in that case.
_checkIBusVersion(1, 5, 10);
- this._panelService.connect('set-content-type', Lang.bind(this, this._setContentType));
+ this._panelService.connect('set-content-type', this._setContentType.bind(this));
} catch (e) {
}
// If an engine is already active we need to get its properties
this._enabled = true;
this._currentFocus = null;
this._ibus = IBus.Bus.new_async();
- this._ibus.connect('connected', Lang.bind(this, this._onConnected));
- this._ibus.connect('disconnected', Lang.bind(this, this._clear));
- this.connect('notify::can-show-preedit', Lang.bind(this, this._updateCapabilities));
+ this._ibus.connect('connected', this._onConnected.bind(this));
+ this._ibus.connect('disconnected', this._clear.bind(this));
+ this.connect('notify::can-show-preedit', this._updateCapabilities.bind(this));
this._inputSourceManager = Keyboard.getInputSourceManager();
this._sourceChangedId = this._inputSourceManager.connect('current-source-changed',
- Lang.bind(this, this._onSourceChanged));
+ this._onSourceChanged.bind(this));
this._currentSource = this._inputSourceManager.currentSource;
if (this._ibus.is_connected())
_onConnected() {
this._ibus.create_input_context_async ('gnome-shell', -1, null,
- Lang.bind(this, this._setContext));
+ this._setContext.bind(this));
},
_setContext(bus, res) {
this._context = this._ibus.create_input_context_async_finish(res);
this._context.connect('enabled', () => { this._enabled = true });
this._context.connect('disabled', () => { this._enabled = false });
- this._context.connect('commit-text', Lang.bind(this, this._onCommitText));
- this._context.connect('delete-surrounding-text', Lang.bind(this, this._onDeleteSurroundingText));
- this._context.connect('update-preedit-text', Lang.bind(this, this._onUpdatePreeditText));
+ this._context.connect('commit-text', this._onCommitText.bind(this));
+ this._context.connect('delete-surrounding-text', this._onDeleteSurroundingText.bind(this));
+ this._context.connect('update-preedit-text', this._onUpdatePreeditText.bind(this));
this._updateCapabilities();
},
'org.freedesktop.login1',
'/org/freedesktop/login1');
this._proxy.connectSignal('PrepareForSleep',
- Lang.bind(this, this._prepareForSleep));
+ this._prepareForSleep.bind(this));
},
getCurrentSessionProxy(callback) {
this._numLoadInhibitors = 1;
this._managerProxy.init_async(GLib.PRIORITY_DEFAULT,
this._cancellable,
- Lang.bind(this, this._onManagerProxyLoaded));
+ this._onManagerProxyLoaded.bind(this));
},
_tryToCompleteLoad() {
this._numLoadInhibitors++;
this._addInterface(objectPath,
interfaceName,
- Lang.bind(this, this._tryToCompleteLoad));
+ this._tryToCompleteLoad.bind(this));
}
}
this._tryToCompleteLoad();
name: "org.gnome.SettingsDaemon.Smartcard",
objectPath: '/org/gnome/SettingsDaemon/Smartcard',
knownInterfaces: [ SmartcardTokenIface ],
- onLoaded: Lang.bind(this, this._onLoaded) });
+ onLoaded: this._onLoaded.bind(this) });
this._insertedTokens = {};
this._loginToken = null;
},
this._boxPointer = boxpointer;
if (boxpointer)
- this._boxPointer.connect('arrow-side-changed', Lang.bind(this, this._sync));
+ this._boxPointer.connect('arrow-side-changed', this._sync.bind(this));
},
_computeBoxPointerOffset() {
this._appSystem = Shell.AppSystem.get_default();
this._appSystem.connect('installed-changed',
- Lang.bind(this, this._onInstalledChanged));
+ this._onInstalledChanged.bind(this));
this._onInstalledChanged();
},
});
});
this._permStore.connectSignal('Changed',
- Lang.bind(this, this._onPermStoreChanged));
+ this._onPermStoreChanged.bind(this));
this._locationSettings = new Gio.Settings({ schema_id: 'org.gnome.system.location' });
this._locationSettings.connect('changed::enabled',
- Lang.bind(this, this._updateAutoLocation));
+ this._updateAutoLocation.bind(this));
this._world = GWeather.Location.get_world();
'org.gnome.Weather.Application');
this._weatherAppMon.connect('available-changed', () => { this.emit('changed'); });
this._weatherAppMon.watchSetting('automatic-location',
- Lang.bind(this, this._onAutomaticLocationChanged));
+ this._onAutomaticLocationChanged.bind(this));
this._weatherAppMon.watchSetting('locations',
- Lang.bind(this, this._onLocationsChanged));
+ this._onLocationsChanged.bind(this));
},
get available() {
this._gclueLocationChangedId =
this._gclueService.connect('notify::location',
- Lang.bind(this, this._onGClueLocationChanged));
+ this._onGClueLocationChanged.bind(this));
this._onGClueLocationChanged();
} else {
if (this._gclueLocationChangedId)
_init(application, url, timestamp, doneCallback) {
this.parent({ application: application });
- this.connect('delete-event', Lang.bind(this, this.destroyWindow));
+ this.connect('delete-event', this.destroyWindow.bind(this));
this._headerBar = new PortalHeaderBar();
this._headerBar.setSecurityIcon(PortalHelperSecurityLevel.NOT_YET_DETERMINED);
this.set_titlebar(this._headerBar);
this._webContext.set_network_proxy_settings(WebKit.NetworkProxyMode.NO_PROXY, null);
this._webView = WebKit.WebView.new_with_context(this._webContext);
- this._webView.connect('decide-policy', Lang.bind(this, this._onDecidePolicy));
- this._webView.connect('load-changed', Lang.bind(this, this._onLoadChanged));
- this._webView.connect('insecure-content-detected', Lang.bind(this, this._onInsecureContentDetected));
- this._webView.connect('load-failed-with-tls-errors', Lang.bind(this, this._onLoadFailedWithTlsErrors));
+ this._webView.connect('decide-policy', this._onDecidePolicy.bind(this));
+ this._webView.connect('load-changed', this._onLoadChanged.bind(this));
+ this._webView.connect('insecure-content-detected', this._onInsecureContentDetected.bind(this));
+ this._webView.connect('load-failed-with-tls-errors', this._onLoadFailedWithTlsErrors.bind(this));
this._webView.load_uri(url);
- this._webView.connect('notify::uri', Lang.bind(this, this._syncUri));
+ this._webView.connect('notify::uri', this._syncUri.bind(this));
this._syncUri();
this.add(this._webView);
!forceAppFocus) {
this._thumbnailTimeoutId = Mainloop.timeout_add (
THUMBNAIL_POPUP_TIME,
- Lang.bind(this, this._timeoutPopupThumbnails));
+ this._timeoutPopupThumbnails.bind(this));
GLib.Source.set_name_by_id(this._thumbnailTimeoutId, '[gnome-shell] this._timeoutPopupThumbnails');
}
},
_createThumbnails() {
this._thumbnails = new ThumbnailList (this._items[this._selectedIndex].cachedWindows);
- this._thumbnails.connect('item-activated', Lang.bind(this, this._windowActivated));
- this._thumbnails.connect('item-entered', Lang.bind(this, this._windowEntered));
- this._thumbnails.connect('item-removed', Lang.bind(this, this._windowRemoved));
+ this._thumbnails.connect('item-activated', this._windowActivated.bind(this));
+ this._thumbnails.connect('item-entered', this._windowEntered.bind(this));
+ this._thumbnails.connect('item-removed', this._windowRemoved.bind(this));
this._thumbnails.actor.connect('destroy', () => {
this._thumbnails = null;
this._thumbnailsFocused = false;
this.actor.add_constraint(constraint);
this.actor.connect('notify::allocation',
- Lang.bind(this, this._onAllocationChanged));
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this._onAllocationChanged.bind(this));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
},
set window(w) {
// We don't show an actual popup, so just provide what SwitcherPopup
// expects instead of inheriting from SwitcherList
this._switcherList = { actor: new St.Widget(),
- highlight: Lang.bind(this, this._highlightItem),
+ highlight: this._highlightItem.bind(this),
connect() {} };
},
this._altTabPopup = altTabPopup;
this._mouseTimeOutId = 0;
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
},
_onDestroy() {
this._thumbnailBins[i].set_height(binHeight);
this._thumbnailBins[i].add_actor(clone);
- clone._destroyId = mutterWindow.connect('destroy', Lang.bind(this, this._removeThumbnail, clone));
+ clone._destroyId = mutterWindow.connect('destroy', source => {
+ this._removeThumbnail(source, clone);
+ });
this._clones.push(clone);
}
_init(file, width, height, speed) {
this.actor = new St.Bin();
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._speed = speed;
this._isLoaded = false;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
this._animations = St.TextureCache.get_default().load_sliced_image (file, width, height, scaleFactor,
- Lang.bind(this, this._animationsLoaded));
+ this._animationsLoaded.bind(this));
this.actor.set_child(this._animations);
},
if (this._frame == 0)
this._showFrame(0);
- this._timeoutId = GLib.timeout_add(GLib.PRIORITY_LOW, this._speed, Lang.bind(this, this._update));
+ this._timeoutId = GLib.timeout_add(GLib.PRIORITY_LOW, this._speed, this._update.bind(this));
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._update');
}
(indicators, pageIndex) => {
this.goToPage(pageIndex);
});
- this._pageIndicators.actor.connect('scroll-event', Lang.bind(this, this._onScroll));
+ this._pageIndicators.actor.connect('scroll-event', this._onScroll.bind(this));
this.actor.add_actor(this._pageIndicators.actor);
this.folderIcons = [];
box.add_actor(this._stack);
this._scrollView.add_actor(box);
- this._scrollView.connect('scroll-event', Lang.bind(this, this._onScroll));
+ this._scrollView.connect('scroll-event', this._onScroll.bind(this));
let panAction = new Clutter.PanAction({ interpolate: false });
- panAction.connect('pan', Lang.bind(this, this._onPan));
- panAction.connect('gesture-cancel', Lang.bind(this, this._onPanEnd));
- panAction.connect('gesture-end', Lang.bind(this, this._onPanEnd));
+ panAction.connect('pan', this._onPan.bind(this));
+ panAction.connect('gesture-cancel', this._onPanEnd.bind(this));
+ panAction.connect('gesture-end', this._onPanEnd.bind(this));
this._panAction = panAction;
this._scrollView.add_action(panAction);
this._panning = false;
if (this.actor.mapped) {
this._keyPressEventId =
global.stage.connect('key-press-event',
- Lang.bind(this, this._onKeyPressEvent));
+ this._onKeyPressEvent.bind(this));
} else {
if (this._keyPressEventId)
global.stage.disconnect(this._keyPressEventId);
}
});
- this._redisplayWorkId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._redisplay));
+ this._redisplayWorkId = Main.initializeDeferredWork(this.actor, this._redisplay.bind(this));
Shell.AppSystem.get_default().connect('installed-changed', () => {
Main.queueDeferredWork(this._redisplayWorkId);
folders.forEach(id => {
let path = this._folderSettings.path + 'folders/' + id + '/';
let icon = new FolderIcon(id, path, this);
- icon.connect('name-changed', Lang.bind(this, this._itemNameChanged));
- icon.connect('apps-changed', Lang.bind(this, this._refilterApps));
+ icon.connect('name-changed', this._itemNameChanged.bind(this));
+ icon.connect('apps-changed', this._refilterApps.bind(this));
this.addItem(icon);
this.folderIcons.push(icon);
});
_init() {
this._privacySettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.privacy' });
this._privacySettings.connect('changed::remember-app-usage',
- Lang.bind(this, this._updateFrequentVisibility));
+ this._updateFrequentVisibility.bind(this));
this._views = [];
this._viewStackLayout = new ViewStackLayout();
this._viewStack = new St.Widget({ x_expand: true, y_expand: true,
layout_manager: this._viewStackLayout });
- this._viewStackLayout.connect('allocated-size-changed', Lang.bind(this, this._onAllocatedSizeChanged));
+ this._viewStackLayout.connect('allocated-size-changed', this._onAllocatedSizeChanged.bind(this));
this.actor.add_actor(this._viewStack);
let layout = new ControlsBoxLayout({ homogeneous: true });
this._controls = new St.Widget({ style_class: 'app-view-controls',
Gio.DBus.system.watch_name(SWITCHEROO_BUS_NAME,
Gio.BusNameWatcherFlags.NONE,
- Lang.bind(this, this._switcherooProxyAppeared),
+ this._switcherooProxyAppeared.bind(this),
() => {
this._switcherooProxy = null;
this._updateDiscreteGpuAvailable();
this.actor.add_actor(scrollableContainer);
let action = new Clutter.PanAction({ interpolate: true });
- action.connect('pan', Lang.bind(this, this._onPan));
+ action.connect('pan', this._onPan.bind(this));
this.actor.add_action(action);
},
// whether we need to update arrow side, position etc.
this._popupInvalidated = false;
- this.icon = new IconGrid.BaseIcon('', { createIcon: Lang.bind(this, this._createIcon), setSizeManually: true });
+ this.icon = new IconGrid.BaseIcon('', { createIcon: this._createIcon.bind(this), setSizeManually: true });
this.actor.set_child(this.icon.actor);
this.actor.label_actor = this.icon.label;
this._popup.popdown();
});
- this._folder.connect('changed', Lang.bind(this, this._redisplay));
+ this._folder.connect('changed', this._redisplay.bind(this));
this._redisplay();
},
this._boxPointer.bin.set_child(this._view.actor);
this.closeButton = Util.makeCloseButton(this._boxPointer);
- this.closeButton.connect('clicked', Lang.bind(this, this.popdown));
+ this.closeButton.connect('clicked', this.popdown.bind(this));
this.actor.add_actor(this.closeButton);
this._boxPointer.actor.bind_property('opacity', this.closeButton, 'opacity',
source.actor.connect('destroy', () => { this.actor.destroy(); });
this._grabHelper = new GrabHelper.GrabHelper(this.actor);
this._grabHelper.addActor(Main.layoutManager.overviewGroup);
- this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress));
+ this.actor.connect('key-press-event', this._onKeyPress.bind(this));
},
_onKeyPress(actor, event) {
return;
this._isOpen = this._grabHelper.grab({ actor: this.actor,
- onUngrab: Lang.bind(this, this.popdown) });
+ onUngrab: this.popdown.bind(this) });
if (!this._isOpen)
return;
let isDraggable = appIconParams['isDraggable'];
delete iconParams['isDraggable'];
- iconParams['createIcon'] = Lang.bind(this, this._createIcon);
+ iconParams['createIcon'] = this._createIcon.bind(this);
iconParams['setSizeManually'] = true;
this.icon = new IconGrid.BaseIcon(app.get_name(), iconParams);
this._iconContainer.add_child(this.icon.actor);
this.actor.label_actor = this.icon.label;
- this.actor.connect('leave-event', Lang.bind(this, this._onLeaveEvent));
- this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
- this.actor.connect('touch-event', Lang.bind(this, this._onTouchEvent));
- this.actor.connect('clicked', Lang.bind(this, this._onClicked));
- this.actor.connect('popup-menu', Lang.bind(this, this._onKeyboardPopupMenu));
+ this.actor.connect('leave-event', this._onLeaveEvent.bind(this));
+ this.actor.connect('button-press-event', this._onButtonPress.bind(this));
+ this.actor.connect('touch-event', this._onTouchEvent.bind(this));
+ this.actor.connect('clicked', this._onClicked.bind(this));
+ this.actor.connect('popup-menu', this._onKeyboardPopupMenu.bind(this));
this._menu = null;
this._menuManager = new PopupMenu.PopupMenuManager(this);
});
}
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._menuTimeoutId = 0;
this._stateChangedId = this.app.connect('notify::state', () => {
_init() {
this._favorites = {};
- global.settings.connect('changed::' + this.FAVORITE_APPS_KEY, Lang.bind(this, this._onFavsChanged));
+ global.settings.connect('changed::' + this.FAVORITE_APPS_KEY, this._onFavsChanged.bind(this));
this.reload();
},
this._selectionBox = new St.BoxLayout({ style_class: 'audio-selection-box' });
this.contentLayout.add(this._selectionBox, { expand: true });
- this.addButton({ action: Lang.bind(this, this._openSettings),
+ this.addButton({ action: this._openSettings.bind(this),
label: _("Sound Settings") });
- this.addButton({ action: Lang.bind(this, this.close),
+ this.addButton({ action: this.close.bind(this),
label: _("Cancel"),
key: Clutter.Escape });
},
}
dialog._sender = invocation.get_sender();
- dialog.connect('closed', Lang.bind(this, this._onDialogClosed));
+ dialog.connect('closed', this._onDialogClosed.bind(this));
dialog.connect('device-selected',
- Lang.bind(this, this._onDeviceSelected));
+ this._onDeviceSelected.bind(this));
dialog.open();
this._audioSelectionDialog = dialog;
this._backgrounds = [];
this._monitorsChangedId = global.screen.connect('monitors-changed',
- Lang.bind(this, this._onMonitorsChanged));
+ this._onMonitorsChanged.bind(this));
},
_onMonitorsChanged() {
y_fill: true });
this._container = new Shell.GenericContainer();
this.actor.set_child(this._container);
- this._container.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this._container.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this._container.connect('allocate', Lang.bind(this, this._allocate));
+ this._container.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this._container.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this._container.connect('allocate', this._allocate.bind(this));
this.bin = new St.Bin(binProperties);
this._container.add_actor(this.bin);
this._border = new St.DrawingArea();
- this._border.connect('repaint', Lang.bind(this, this._drawBorder));
+ this._border.connect('repaint', this._drawBorder.bind(this));
this._container.add_actor(this._border);
this.bin.raise(this._border);
this._xOffset = 0;
}
}
- this._dbusProxy.connectSignal('Changed', Lang.bind(this, this._onChanged));
+ this._dbusProxy.connectSignal('Changed', this._onChanged.bind(this));
this._dbusProxy.connect('notify::g-name-owner', () => {
if (this._dbusProxy.g_name_owner)
this._dbusProxy.GetEventsRemote(this._curRequestBegin.getTime() / 1000,
this._curRequestEnd.getTime() / 1000,
forceReload,
- Lang.bind(this, this._onEventsReceived),
+ this._onEventsReceived.bind(this),
Gio.DBusCallFlags.NONE);
}
},
this._weekStart = Shell.util_get_week_start();
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.calendar' });
- this._settings.connect('changed::' + SHOW_WEEKDATE_KEY, Lang.bind(this, this._onSettingsChange));
+ this._settings.connect('changed::' + SHOW_WEEKDATE_KEY, this._onSettingsChange.bind(this));
this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY);
/**
reactive: true });
this.actor.connect('scroll-event',
- Lang.bind(this, this._onScroll));
+ this._onScroll.bind(this));
this._buildHeader ();
},
accessible_name: _("Previous month"),
can_focus: true });
this._topBox.add(this._backButton);
- this._backButton.connect('clicked', Lang.bind(this, this._onPrevMonthButtonClicked));
+ this._backButton.connect('clicked', this._onPrevMonthButtonClicked.bind(this));
this._monthLabel = new St.Label({style_class: 'calendar-month-label',
can_focus: true });
accessible_name: _("Next month"),
can_focus: true });
this._topBox.add(this._forwardButton);
- this._forwardButton.connect('clicked', Lang.bind(this, this._onNextMonthButtonClicked));
+ this._forwardButton.connect('clicked', this._onNextMonthButtonClicked.bind(this));
// Add weekday labels...
//
this.close();
});
this._updatedId = notification.connect('updated',
- Lang.bind(this, this._onUpdated));
+ this._onUpdated.bind(this));
},
_getIcon() {
_init() {
this._desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
- this._desktopSettings.connect('changed', Lang.bind(this, this._reloadEvents));
+ this._desktopSettings.connect('changed', this._reloadEvents.bind(this));
this._eventSource = new EmptyEventSource();
this.parent();
can_focus: true });
this.actor.insert_child_below(this._title, null);
- this._title.connect('clicked', Lang.bind(this, this._onTitleClicked));
- this._title.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
+ this._title.connect('clicked', this._onTitleClicked.bind(this));
+ this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
Shell.AppSystem.get_default().connect('installed-changed',
- Lang.bind(this, this._appInstalledChanged));
+ this._appInstalledChanged.bind(this));
this._appInstalledChanged();
},
setEventSource(eventSource) {
this._eventSource = eventSource;
- this._eventSource.connect('changed', Lang.bind(this, this._reloadEvents));
+ this._eventSource.connect('changed', this._reloadEvents.bind(this));
},
get allowed() {
this._sources = new Map();
this._nUrgent = 0;
- Main.messageTray.connect('source-added', Lang.bind(this, this._sourceAdded));
+ Main.messageTray.connect('source-added', this._sourceAdded.bind(this));
Main.messageTray.getSources().forEach(source => {
this._sourceAdded(Main.messageTray, source);
});
- this.actor.connect('notify::mapped', Lang.bind(this, this._onMapped));
+ this.actor.connect('notify::mapped', this._onMapped.bind(this));
},
get allowed() {
this._onSourceDestroy(source, obj);
});
obj.notificationAddedId = source.connect('notification-added',
- Lang.bind(this, this._onNotificationAdded));
+ this._onNotificationAdded.bind(this));
this._sources.set(source, obj);
},
this._eventsSection = new EventsSection();
this._addSection(this._eventsSection);
- Main.sessionMode.connect('updated', Lang.bind(this, this._sync));
+ Main.sessionMode.connect('updated', this._sync.bind(this));
},
_addSection(section) {
this._removeSection(section);
});
obj.visibleId = section.actor.connect('notify::visible',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
obj.emptyChangedId = section.connect('empty-changed',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
obj.canClearChangedId = section.connect('can-clear-changed',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
obj.keyFocusId = section.connect('key-focus-in',
- Lang.bind(this, this._onKeyFocusIn));
+ this._onKeyFocusIn.bind(this));
this._sections.set(section, obj);
this._sectionList.add_actor(section.actor);
this._dialog.addContent(this._createDialogContent());
this._dialog.addButton({ label: _('Force Quit'),
- action: Lang.bind(this, this._onClose),
+ action: this._onClose.bind(this),
default: true });
this._dialog.addButton({ label: _('Wait'),
- action: Lang.bind(this, this._onWait),
+ action: this._onWait.bind(this),
key: Clutter.Escape });
global.focus_manager.add_group(this._dialog);
this._allComponents = {};
this._enabledComponents = [];
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
},
this._volumeQueue = [];
this._session = new GnomeSession.SessionManager();
this._session.connectSignal('InhibitorAdded',
- Lang.bind(this, this._InhibitorsChanged));
+ this._InhibitorsChanged.bind(this));
this._session.connectSignal('InhibitorRemoved',
- Lang.bind(this, this._InhibitorsChanged));
+ this._InhibitorsChanged.bind(this));
this._inhibited = false;
this._volumeMonitor = Gio.VolumeMonitor.get();
},
enable() {
- this._volumeAddedId = this._volumeMonitor.connect('volume-added', Lang.bind(this, this._onVolumeAdded));
- this._volumeRemovedId = this._volumeMonitor.connect('volume-removed', Lang.bind(this, this._onVolumeRemoved));
- this._driveConnectedId = this._volumeMonitor.connect('drive-connected', Lang.bind(this, this._onDriveConnected));
- this._driveDisconnectedId = this._volumeMonitor.connect('drive-disconnected', Lang.bind(this, this._onDriveDisconnected));
- this._driveEjectButtonId = this._volumeMonitor.connect('drive-eject-button', Lang.bind(this, this._onDriveEjectButton));
+ this._volumeAddedId = this._volumeMonitor.connect('volume-added', this._onVolumeAdded.bind(this));
+ this._volumeRemovedId = this._volumeMonitor.connect('volume-removed', this._onVolumeRemoved.bind(this));
+ this._driveConnectedId = this._volumeMonitor.connect('drive-connected', this._onDriveConnected.bind(this));
+ this._driveDisconnectedId = this._volumeMonitor.connect('drive-disconnected', this._onDriveDisconnected.bind(this));
+ this._driveEjectButtonId = this._volumeMonitor.connect('drive-eject-button', this._onDriveEjectButton.bind(this));
- this._mountAllId = Mainloop.idle_add(Lang.bind(this, this._startupMountAll));
+ this._mountAllId = Mainloop.idle_add(this._startupMountAll.bind(this));
GLib.Source.set_name_by_id(this._mountAllId, '[gnome-shell] this._startupMountAll');
},
volume._operation = operation;
volume.mount(0, mountOp, null,
- Lang.bind(this, this._onVolumeMounted));
+ this._onVolumeMounted.bind(this));
},
_onVolumeMounted(volume, res) {
if (shouldScan) {
// guess mount's content types using GIO
mount.guess_content_type(false, null,
- Lang.bind(this,
- this._onContentTypeGuessed));
+ this._onContentTypeGuessed.bind(this));
} else {
this._emitCallback(mount, []);
}
},
enable() {
- this._mountAddedId = this._volumeMonitor.connect('mount-added', Lang.bind(this, this._onMountAdded));
- this._mountRemovedId = this._volumeMonitor.connect('mount-removed', Lang.bind(this, this._onMountRemoved));
+ this._mountAddedId = this._volumeMonitor.connect('mount-added', this._onMountAdded.bind(this));
+ this._mountRemovedId = this._volumeMonitor.connect('mount-removed', this._onMountRemoved.bind(this));
},
disable() {
this.parent({ styleClass: 'prompt-dialog' });
this.prompt = new Shell.KeyringPrompt();
- this.prompt.connect('show-password', Lang.bind(this, this._onShowPassword));
- this.prompt.connect('show-confirm', Lang.bind(this, this._onShowConfirm));
- this.prompt.connect('prompt-close', Lang.bind(this, this._onHidePrompt));
+ this.prompt.connect('show-password', this._onShowPassword.bind(this));
+ this.prompt.connect('show-confirm', this._onShowConfirm.bind(this));
+ this.prompt.connect('prompt-close', this._onHidePrompt.bind(this));
let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' });
this._content = new Dialog.MessageDialogContent({ icon });
this._controlTable = null;
this._cancelButton = this.addButton({ label: '',
- action: Lang.bind(this, this._onCancelButton),
+ action: this._onCancelButton.bind(this),
key: Clutter.Escape });
this._continueButton = this.addButton({ label: '',
- action: Lang.bind(this, this._onContinueButton),
+ action: this._onContinueButton.bind(this),
default: true });
this.prompt.bind_property('cancel-label', this._cancelButton, 'label', GObject.BindingFlags.SYNC_CREATE);
x_expand: true });
this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
- this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onPasswordActivate));
+ this._passwordEntry.clutter_text.connect('activate', this._onPasswordActivate.bind(this));
let spinnerIcon = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg');
this._workSpinner = new Animation.AnimatedIcon(spinnerIcon, WORK_SPINNER_ICON_SIZE);
x_expand: true });
this._confirmEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
ShellEntry.addContextMenu(this._confirmEntry, { isPassword: true });
- this._confirmEntry.clutter_text.connect('activate', Lang.bind(this, this._onConfirmActivate));
+ this._confirmEntry.clutter_text.connect('activate', this._onConfirmActivate.bind(this));
if (rtl) {
layout.attach(this._confirmEntry, 0, row, 1, 1);
layout.attach(label, 1, row, 1, 1);
_init() {
this.prompt = new Shell.KeyringPrompt();
- this.prompt.connect('show-password',
- Lang.bind(this, this._cancelPrompt));
- this.prompt.connect('show-confirm', Lang.bind(this,
- this._cancelPrompt));
+ this.prompt.connect('show-password', this._cancelPrompt.bind(this));
+ this.prompt.connect('show-confirm', this._cancelPrompt.bind(this));
},
_cancelPrompt() {
initialFocusSet = true;
}
- secret.entry.clutter_text.connect('activate', Lang.bind(this, this._onOk));
+ secret.entry.clutter_text.connect('activate', this._onOk.bind(this));
secret.entry.clutter_text.connect('text-changed', () => {
secret.value = secret.entry.get_text();
if (secret.validate)
contentBox.messageBox.add(secretTable);
this._okButton = { label: _("Connect"),
- action: Lang.bind(this, this._onOk),
+ action: this._onOk.bind(this),
default: true
};
this.setButtons([{ label: _("Cancel"),
- action: Lang.bind(this, this.cancel),
+ action: this.cancel.bind(this),
key: Clutter.KEY_Escape,
},
this._okButton]);
this._readStdoutOldStyle();
this._childWatch = GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid,
- Lang.bind(this, this._vpnChildFinished));
+ this._vpnChildFinished.bind(this));
this._writeConnection();
} catch(e) {
log('Failed to create monitor for VPN plugin dir: ' + e.message);
}
- this._native.connect('new-request', Lang.bind(this, this._newRequest));
- this._native.connect('cancel-request', Lang.bind(this, this._cancelRequest));
+ this._native.connect('new-request', this._newRequest.bind(this));
+ this._native.connect('cancel-request', this._cancelRequest.bind(this));
try {
this._native.init(null);
} catch(e) {
this._user = AccountsService.UserManager.get_default().get_user(userName);
let userRealName = this._user.get_real_name()
this._userLoadedId = this._user.connect('notify::is_loaded',
- Lang.bind(this, this._onUserChanged));
+ this._onUserChanged.bind(this));
this._userChangedId = this._user.connect('changed',
- Lang.bind(this, this._onUserChanged));
+ this._onUserChanged.bind(this));
// Special case 'root'
let userIsRoot = false;
text: "",
can_focus: true});
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
- this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivate));
+ this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
this._passwordBox.add(this._passwordEntry,
{ expand: true });
this._nullMessageLabel.show();
this._cancelButton = this.addButton({ label: _("Cancel"),
- action: Lang.bind(this, this.cancel),
+ action: this.cancel.bind(this),
key: Clutter.Escape });
this._okButton = this.addButton({ label: _("Authenticate"),
- action: Lang.bind(this, this._onAuthenticateButtonPressed),
+ action: this._onAuthenticateButtonPressed.bind(this),
default: true });
this._doneEmitted = false;
this.destroySession();
this._session = new PolkitAgent.Session({ identity: this._identityToAuth,
cookie: this._cookie });
- this._session.connect('completed', Lang.bind(this, this._onSessionCompleted));
- this._session.connect('request', Lang.bind(this, this._onSessionRequest));
- this._session.connect('show-error', Lang.bind(this, this._onSessionShowError));
- this._session.connect('show-info', Lang.bind(this, this._onSessionShowInfo));
+ this._session.connect('completed', this._onSessionCompleted.bind(this));
+ this._session.connect('request', this._onSessionRequest.bind(this));
+ this._session.connect('show-error', this._onSessionShowError.bind(this));
+ this._session.connect('show-info', this._onSessionShowInfo.bind(this));
this._session.initiate();
},
this._currentDialog = null;
this._handle = null;
this._native = new Shell.PolkitAuthenticationAgent();
- this._native.connect('initiate', Lang.bind(this, this._onInitiate));
- this._native.connect('cancel', Lang.bind(this, this._onCancel));
+ this._native.connect('initiate', this._onInitiate.bind(this));
+ this._native.connect('cancel', this._onCancel.bind(this));
},
enable() {
// See https://bugzilla.gnome.org/show_bug.cgi?id=643062 for more
// discussion.
- this._currentDialog.connect('done', Lang.bind(this, this._onDialogDone));
+ this._currentDialog.connect('done', this._onDialogDone.bind(this));
this._currentDialog.performAuthentication();
},
// Allow other clients (such as Empathy) to pre-empt our channels if
// needed
this.set_delegated_channels_callback(
- Lang.bind(this, this._delegatedChannelsCb));
+ this._delegatedChannelsCb.bind(this));
},
vfunc_observe_channels(account, conn, channels,
this._conn = conn;
this._channel = channel;
- this._closedId = this._channel.connect('invalidated', Lang.bind(this, this._channelClosed));
+ this._closedId = this._channel.connect('invalidated', this._channelClosed.bind(this));
this._notifyTimeoutId = 0;
this._presence = contact.get_presence_type();
- this._sentId = this._channel.connect('message-sent', Lang.bind(this, this._messageSent));
- this._receivedId = this._channel.connect('message-received', Lang.bind(this, this._messageReceived));
- this._pendingId = this._channel.connect('pending-message-removed', Lang.bind(this, this._pendingRemoved));
+ this._sentId = this._channel.connect('message-sent', this._messageSent.bind(this));
+ this._receivedId = this._channel.connect('message-received', this._messageReceived.bind(this));
+ this._pendingId = this._channel.connect('pending-message-removed', this._pendingRemoved.bind(this));
- this._notifyAliasId = this._contact.connect('notify::alias', Lang.bind(this, this._updateAlias));
- this._notifyAvatarId = this._contact.connect('notify::avatar-file', Lang.bind(this, this._updateAvatarIcon));
- this._presenceChangedId = this._contact.connect('presence-changed', Lang.bind(this, this._presenceChanged));
+ this._notifyAliasId = this._contact.connect('notify::alias', this._updateAlias.bind(this));
+ this._notifyAvatarId = this._contact.connect('notify::avatar-file', this._updateAvatarIcon.bind(this));
+ this._presenceChangedId = this._contact.connect('presence-changed', this._presenceChanged.bind(this));
// Add ourselves as a source.
Main.messageTray.add(this);
return;
this._notification = new ChatNotification(this);
- this._notification.connect('activated', Lang.bind(this, this.open));
+ this._notification.connect('activated', this.open.bind(this));
this._notification.connect('updated', () => {
if (this._banner && this._banner.expanded)
this._ackMessages();
this._banner = new ChatNotificationBanner(this._notification);
// We ack messages when the user expands the new notification
- let id = this._banner.connect('expanded', Lang.bind(this, this._ackMessages));
+ let id = this._banner.connect('expanded', this._ackMessages.bind(this));
this._banner.actor.connect('destroy', () => {
this._banner.disconnect(id);
this._banner = null;
logManager.get_filtered_events_async(this._account, entity,
Tpl.EventTypeMask.TEXT, SCROLLBACK_HISTORY_LINES,
- null, Lang.bind(this, this._displayPendingMessages));
+ null, this._displayPendingMessages.bind(this));
},
_displayPendingMessages(logManager, result) {
if (this._notifyTimeoutId != 0)
Mainloop.source_remove(this._notifyTimeoutId);
this._notifyTimeoutId = Mainloop.timeout_add(500,
- Lang.bind(this, this._notifyTimeout));
+ this._notifyTimeout.bind(this));
GLib.Source.set_name_by_id(this._notifyTimeoutId, '[gnome-shell] this._notifyTimeout');
},
// from the timestamp of the message.
this._timestampTimeoutId = Mainloop.timeout_add_seconds(
SCROLLBACK_IMMEDIATE_TIME - (currentTime - timestamp),
- Lang.bind(this, this.appendTimestamp));
+ this.appendTimestamp.bind(this));
GLib.Source.set_name_by_id(this._timestampTimeoutId, '[gnome-shell] this.appendTimestamp');
}
}
this._responseEntry = new St.Entry({ style_class: 'chat-response',
x_expand: true,
can_focus: true });
- this._responseEntry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivated));
- this._responseEntry.clutter_text.connect('text-changed', Lang.bind(this, this._onEntryChanged));
+ this._responseEntry.clutter_text.connect('activate', this._onEntryActivated.bind(this));
+ this._responseEntry.clutter_text.connect('text-changed', this._onEntryChanged.bind(this));
this.setActionArea(this._responseEntry);
this._responseEntry.clutter_text.connect('key-focus-in', () => {
this._composingTimeoutId = Mainloop.timeout_add_seconds(
COMPOSING_STOP_TIMEOUT,
- Lang.bind(this, this._composingStopTimeout));
+ this._composingStopTimeout.bind(this));
GLib.Source.set_name_by_id(this._composingTimeoutId, '[gnome-shell] this._composingStopTimeout');
} else {
this.notification.source.setChatState(Tp.ChannelChatState.ACTIVE);
this._items = [];
this.addGroup(global.window_group, _("Windows"),
'focus-windows-symbolic', { sortGroup: SortGroup.TOP,
- focusCallback: Lang.bind(this, this._focusWindows) });
+ focusCallback: this._focusWindows.bind(this) });
},
addGroup(root, name, icon, params) {
items.push({ name: windows[i].title,
proxy: windows[i].get_compositor_private(),
- focusCallback: Lang.bind(windows[i],
- function(timestamp) {
- Main.activateWindow(this, timestamp);
- }),
+ focusCallback: function(timestamp) {
+ Main.activateWindow(this, timestamp);
+ }.bind(windows[i]),
iconActor: icon,
iconName: iconName,
sortGroup: SortGroup.MIDDLE });
if (!items.length)
return;
- items.sort(Lang.bind(this, this._sortItems));
+ items.sort(this._sortItems.bind(this));
if (!this._popup) {
this._popup = new CtrlAltTabPopup(items);
this.icon = new IconGrid.BaseIcon(_("Show Applications"),
{ setSizeManually: true,
showLabel: false,
- createIcon: Lang.bind(this, this._createIcon) });
+ createIcon: this._createIcon.bind(this) });
this.toggleButton.add_actor(this.icon.actor);
this.toggleButton._delegate = this;
this._maxHeight = this.actor.height;
});
- this._workId = Main.initializeDeferredWork(this._box, Lang.bind(this, this._redisplay));
+ this._workId = Main.initializeDeferredWork(this._box, this._redisplay.bind(this));
this._appSystem = Shell.AppSystem.get_default();
AppFavorites.getAppFavorites().reload();
this._queueRedisplay();
});
- AppFavorites.getAppFavorites().connect('changed', Lang.bind(this, this._queueRedisplay));
- this._appSystem.connect('app-state-changed', Lang.bind(this, this._queueRedisplay));
+ AppFavorites.getAppFavorites().connect('changed', this._queueRedisplay.bind(this));
+ this._appSystem.connect('app-state-changed', this._queueRedisplay.bind(this));
Main.overview.connect('item-drag-begin',
- Lang.bind(this, this._onDragBegin));
+ this._onDragBegin.bind(this));
Main.overview.connect('item-drag-end',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.overview.connect('item-drag-cancelled',
- Lang.bind(this, this._onDragCancelled));
+ this._onDragCancelled.bind(this));
// Translators: this is the name of the dock/favorites area on
// the left of the overview
_onDragBegin() {
this._dragCancelled = false;
this._dragMonitor = {
- dragMotion: Lang.bind(this, this._onDragMotion)
+ dragMotion: this._onDragMotion.bind(this)
};
DND.addDragMonitor(this._dragMonitor);
this._clockAppMon = new Util.AppSettingsMonitor('org.gnome.clocks.desktop',
'org.gnome.clocks');
this._clockAppMon.connect('available-changed',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
this._clockAppMon.watchSetting('world-clocks',
- Lang.bind(this, this._clocksChanged));
+ this._clocksChanged.bind(this));
this._sync();
},
if (this._grid.get_n_children() > 1) {
if (!this._clockNotifyId)
this._clockNotifyId =
- this._clock.connect('notify::clock', Lang.bind(this, this._updateLabels));
+ this._clock.connect('notify::clock', this._updateLabels.bind(this));
this._updateLabels();
} else {
if (this._clockNotifyId)
this._conditionsLabel.clutter_text.line_wrap = true;
box.add_child(this._conditionsLabel);
- this._weatherClient.connect('changed', Lang.bind(this, this._sync));
+ this._weatherClient.connect('changed', this._sync.bind(this));
this._sync();
},
this._sources = [];
- Main.messageTray.connect('source-added', Lang.bind(this, this._onSourceAdded));
- Main.messageTray.connect('source-removed', Lang.bind(this, this._onSourceRemoved));
- Main.messageTray.connect('queue-changed', Lang.bind(this, this._updateCount));
+ Main.messageTray.connect('source-added', this._onSourceAdded.bind(this));
+ Main.messageTray.connect('source-removed', this._onSourceRemoved.bind(this));
+ Main.messageTray.connect('queue-changed', this._updateCount.bind(this));
let sources = Main.messageTray.getSources();
sources.forEach(source => { this._onSourceAdded(null, source); });
},
_onSourceAdded(tray, source) {
- source.connect('count-updated', Lang.bind(this, this._updateCount));
+ source.connect('count-updated', this._updateCount.bind(this));
this._sources.push(source);
this._updateCount();
},
this._clock = new GnomeDesktop.WallClock();
this._clock.bind_property('clock', this._clockDisplay, 'text', GObject.BindingFlags.SYNC_CREATE);
- this._clock.connect('notify::timezone', Lang.bind(this, this._updateTimeZone));
+ this._clock.connect('notify::timezone', this._updateTimeZone.bind(this));
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
},
_init(parentActor, styleClass) {
this.parent({ layout_manager: new Clutter.BinLayout() });
- this.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.connect('destroy', this._onDestroy.bind(this));
this._initialKeyFocus = null;
this._initialKeyFocusDestroyId = 0;
this._dialog.add_style_class_name(styleClass);
this._parentActor = parentActor;
- this._eventId = this._parentActor.connect('event', Lang.bind(this, this._modalEventHandler));
+ this._eventId = this._parentActor.connect('event', this._modalEventHandler.bind(this));
this._parentActor.add_child(this);
},
this.actor = actor;
if (!params.manualMode) {
this.actor.connect('button-press-event',
- Lang.bind(this, this._onButtonPress));
+ this._onButtonPress.bind(this));
this.actor.connect('touch-event',
- Lang.bind(this, this._onTouchEvent));
+ this._onTouchEvent.bind(this));
}
this.actor.connect('destroy', () => {
_grabActor() {
this._grabDevice(this.actor);
this._onEventId = this.actor.connect('event',
- Lang.bind(this, this._onEvent));
+ this._onEvent.bind(this));
},
_ungrabActor() {
return;
this._updateHoverId = GLib.idle_add(GLib.PRIORITY_DEFAULT,
- Lang.bind(this, this._updateDragHover));
+ this._updateDragHover.bind(this));
GLib.Source.set_name_by_id(this._updateHoverId, '[gnome-shell] this._updateDragHover');
},
// during it
this._dragActorDestroyId =
this._dragActor.connect('destroy',
- Lang.bind(this, this._finishAnimation));
+ this._finishAnimation.bind(this));
params['opacity'] = this._dragOrigOpacity;
params['transition'] = 'easeOutQuad';
return;
}
this._powerProxy.connect('g-properties-changed',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
this._sync();
});
this._sessions = [];
this.connect('destroy',
- Lang.bind(this, this._onDestroy));
+ this._onDestroy.bind(this));
this.connect('opened',
- Lang.bind(this, this._onOpened));
+ this._onOpened.bind(this));
- this._userLoadedId = this._user.connect('notify::is_loaded', Lang.bind(this, this._sync));
- this._userChangedId = this._user.connect('changed', Lang.bind(this, this._sync));
+ this._userLoadedId = this._user.connect('notify::is_loaded', this._sync.bind(this));
+ this._userChangedId = this._user.connect('changed', this._sync.bind(this));
let mainContentLayout = new St.BoxLayout({ vertical: false });
this.contentLayout.add(mainContentLayout,
y_align: St.Align.START });
this._checkBox = new CheckBox.CheckBox();
- this._checkBox.actor.connect('clicked', Lang.bind(this, this._sync));
+ this._checkBox.actor.connect('clicked', this._sync.bind(this));
messageLayout.add(this._checkBox.actor);
this._batteryWarning = new St.Label({ style_class: 'end-session-dialog-warning',
_updateButtons() {
let dialogContent = DialogContent[this._type];
- let buttons = [{ action: Lang.bind(this, this.cancel),
+ let buttons = [{ action: this.cancel.bind(this),
label: _("Cancel"),
key: Clutter.Escape }];
this._invocation = invocation;
this.setButtons([{ label: _("Cancel"),
- action: Lang.bind(this, this._onCancelButtonPressed),
+ action: this._onCancelButtonPressed.bind(this),
key: Clutter.Escape
},
{ label: _("Install"),
- action: Lang.bind(this, this._onInstallButtonPressed),
+ action: this._onInstallButtonPressed.bind(this),
default: true
}]);
var _signals = {};
Signals.addSignalMethods(_signals);
-var connect = Lang.bind(_signals, _signals.connect);
-var disconnect = Lang.bind(_signals, _signals.disconnect);
+var connect = _signals.connect.bind(_signals);
+var disconnect = _signals.disconnect.bind(_signals);
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
const DISABLE_USER_EXTENSIONS_KEY = 'disable-user-extensions';
Name: 'FocusCaretTracker',
_init() {
- this._atspiListener = Atspi.EventListener.new(Lang.bind(this, this._onChanged));
+ this._atspiListener = Atspi.EventListener.new(this._onChanged.bind(this));
this._atspiInited = false;
this._focusListenerRegistered = false;
x_fill: true,
y_fill: true });
this.actor._delegate = this;
- this.actor.connect('style-changed',
- Lang.bind(this, this._onStyleChanged));
- this.actor.connect('destroy',
- Lang.bind(this, this._onDestroy));
+ this.actor.connect('style-changed', this._onStyleChanged.bind(this));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._spacing = 0;
let box = new Shell.GenericContainer();
- box.connect('allocate', Lang.bind(this, this._allocate));
+ box.connect('allocate', this._allocate.bind(this));
box.connect('get-preferred-width',
- Lang.bind(this, this._getPreferredWidth));
+ this._getPreferredWidth.bind(this));
box.connect('get-preferred-height',
- Lang.bind(this, this._getPreferredHeight));
+ this._getPreferredHeight.bind(this));
this.actor.set_child(box);
this.iconSize = ICON_SIZE;
this.icon = null;
let cache = St.TextureCache.get_default();
- this._iconThemeChangedId = cache.connect('icon-theme-changed', Lang.bind(this, this._onIconThemeChanged));
+ this._iconThemeChangedId = cache.connect('icon-theme-changed', this._onIconThemeChanged.bind(this));
},
_allocate(actor, box, flags) {
this._fixedHItemSize = this._fixedVItemSize = undefined;
this._grid = new Shell.GenericContainer();
this.actor.add(this._grid, { expand: true, y_align: St.Align.START });
- this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
+ this.actor.connect('style-changed', this._onStyleChanged.bind(this));
// Cancel animations when hiding the overview, to avoid icons
// swarming into the void ...
this._cancelAnimation();
});
- this._grid.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this._grid.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this._grid.connect('allocate', Lang.bind(this, this._allocate));
- this._grid.connect('actor-added', Lang.bind(this, this._childAdded));
- this._grid.connect('actor-removed', Lang.bind(this, this._childRemoved));
+ this._grid.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this._grid.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this._grid.connect('allocate', this._allocate.bind(this));
+ this._grid.connect('actor-added', this._childAdded.bind(this));
+ this._grid.connect('actor-removed', this._childRemoved.bind(this));
},
_keyFocusIn(actor) {
},
_childAdded(grid, child) {
- child._iconGridKeyFocusInId = child.connect('key-focus-in', Lang.bind(this, this._keyFocusIn));
+ child._iconGridKeyFocusInId = child.connect('key-focus-in', this._keyFocusIn.bind(this));
},
_childRemoved(grid, child) {
this._updateSpacingForSize(availWidth, availHeight);
}
Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
- Lang.bind(this, this._updateIconSizes));
+ this._updateIconSizes.bind(this));
},
// Note that this is ICON_SIZE as used by BaseIcon, not elsewhere in IconGrid; it's a bit messed up
let deviceManager = Clutter.DeviceManager.get_default();
deviceManager.connect('kbd-a11y-flags-changed',
- Lang.bind(this, this._showKbdA11yDialog));
+ this._showKbdA11yDialog.bind(this));
},
_showKbdA11yDialog(deviceManager, newFlags, whatChanged) {
}
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
- this.addAction(_("Region & Language Settings"), Lang.bind(this, this._launchSettings));
+ this.addAction(_("Region & Language Settings"), this._launchSettings.bind(this));
this._capturedEventId = 0;
this._unmapId = actor.connect('notify::mapped', () => {
open(animate) {
this.parent(animate);
this._capturedEventId = global.stage.connect('captured-event',
- Lang.bind(this, this._onCapturedEvent));
+ this._onCapturedEvent.bind(this));
},
close(animate) {
*/
this.actor = new St.BoxLayout ({ style_class: 'key-container' });
this.actor.add(this.keyButton, { expand: true, x_fill: true });
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._extended_keys = extendedKeys;
this._extended_keyboard = null;
_showSubkeys() {
this._boxPointer.show(BoxPointer.PopupAnimation.FULL);
this._capturedEventId = global.stage.connect('captured-event',
- Lang.bind(this, this._onCapturedEvent));
+ this._onCapturedEvent.bind(this));
this._unmapId = this.keyButton.connect('notify::mapped', () => {
if (!this.keyButton.is_mapped())
this._hideSubkeys();
this._focusInExtendedKeys = false;
this._focusCaretTracker = new FocusCaretTracker.FocusCaretTracker();
- this._focusCaretTracker.connect('focus-changed', Lang.bind(this, this._onFocusChanged));
- this._focusCaretTracker.connect('caret-moved', Lang.bind(this, this._onCaretMoved));
+ this._focusCaretTracker.connect('focus-changed', this._onFocusChanged.bind(this));
+ this._focusCaretTracker.connect('caret-moved', this._onCaretMoved.bind(this));
this._languagePopup = null;
this._currentAccessible = null;
this._caretTrackingEnabled = false;
this._latched = false; // current level is latched
this._a11yApplicationsSettings = new Gio.Settings({ schema_id: A11Y_APPLICATIONS_SCHEMA });
- this._a11yApplicationsSettings.connect('changed', Lang.bind(this, this._syncEnabled));
+ this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this));
this._lastDeviceId = null;
this._suggestions = null;
this._keyboardRequested = false;
this._keyboardRestingId = 0;
- Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
+ Main.layoutManager.connect('monitors-changed', this._relayout.bind(this));
//Main.inputMethod.connect('cursor-location-changed', (o, rect) => {
// if (this._keyboardVisible) {
// let currentWindow = global.screen.get_display().focus_window;
// keyboard on RTL locales.
this.actor.text_direction = Clutter.TextDirection.LTR;
- this._keyboardNotifyId = this._keyboardController.connect('active-group', Lang.bind(this, this._onGroupChanged));
- this._keyboardGroupsChangedId = this._keyboardController.connect('groups-changed', Lang.bind(this, this._onKeyboardGroupsChanged));
- this._keyboardStateId = this._keyboardController.connect('panel-state', Lang.bind(this, this._onKeyboardStateChanged));
- this._focusNotifyId = global.stage.connect('notify::key-focus', Lang.bind(this, this._onKeyFocusChanged));
+ this._keyboardNotifyId = this._keyboardController.connect('active-group', this._onGroupChanged.bind(this));
+ this._keyboardGroupsChangedId = this._keyboardController.connect('groups-changed', this._onKeyboardGroupsChanged.bind(this));
+ this._keyboardStateId = this._keyboardController.connect('panel-state', this._onKeyboardStateChanged.bind(this));
+ this._focusNotifyId = global.stage.connect('notify::key-focus', this._onKeyFocusChanged.bind(this));
this._relayout();
},
this._inputSourceManager = InputSourceManager.getInputSourceManager();
this._sourceChangedId = this._inputSourceManager.connect('current-source-changed',
- Lang.bind(this, this._onSourceChanged));
+ this._onSourceChanged.bind(this));
this._sourcesModifiedId = this._inputSourceManager.connect ('sources-changed',
- Lang.bind(this, this._onSourcesModified));
+ this._onSourcesModified.bind(this));
this._currentSource = this._inputSourceManager.currentSource;
- Main.inputMethod.connect('notify::content-purpose', Lang.bind(this, this._onContentPurposeHintsChanged));
- Main.inputMethod.connect('notify::content-hints', Lang.bind(this, this._onContentPurposeHintsChanged));
+ Main.inputMethod.connect('notify::content-purpose',
+ this._onContentPurposeHintsChanged.bind(this));
+ Main.inputMethod.connect('notify::content-hints',
+ this._onContentPurposeHintsChanged.bind(this));
Main.inputMethod.connect('input-panel-state', (o, state) => {
this.emit('panel-state', state);
});
this.addChrome(this.panelBox, { affectsStruts: true,
trackFullscreen: true });
this.panelBox.connect('allocation-changed',
- Lang.bind(this, this._panelBoxChanged));
+ this._panelBoxChanged.bind(this));
this.modalDialogGroup = new St.Widget({ name: 'modalDialogGroup',
layout_manager: new Clutter.BinLayout() });
// Need to update struts on new workspaces when they are added
global.screen.connect('notify::n-workspaces',
- Lang.bind(this, this._queueUpdateRegions));
+ this._queueUpdateRegions.bind(this));
global.screen.connect('restacked',
- Lang.bind(this, this._windowsRestacked));
+ this._windowsRestacked.bind(this));
global.screen.connect('monitors-changed',
- Lang.bind(this, this._monitorsChanged));
+ this._monitorsChanged.bind(this));
global.screen.connect('in-fullscreen-changed',
- Lang.bind(this, this._updateFullscreen));
+ this._updateFullscreen.bind(this));
this._monitorsChanged();
// NVIDIA drivers don't preserve FBO contents across
// This is called by Main after everything else is constructed
init() {
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._loadBackground();
},
layoutManager: this,
monitorIndex: monitorIndex });
- bgManager.connect('changed', Lang.bind(this, this._addBackgroundMenu));
+ bgManager.connect('changed', this._addBackgroundMenu.bind(this));
this._addBackgroundMenu(bgManager);
return bgManager;
let actorData = Params.parse(params, defaultParams);
actorData.actor = actor;
actorData.visibleId = actor.connect('notify::visible',
- Lang.bind(this, this._queueUpdateRegions));
+ this._queueUpdateRegions.bind(this));
actorData.allocationId = actor.connect('notify::allocation',
- Lang.bind(this, this._queueUpdateRegions));
+ this._queueUpdateRegions.bind(this));
actorData.destroyId = actor.connect('destroy',
- Lang.bind(this, this._untrackActor));
+ this._untrackActor.bind(this));
// Note that destroying actor will unset its parent, so we don't
// need to connect to 'destroy' too.
global.window_group.visible = windowsVisible;
global.top_window_group.visible = windowsVisible;
- this._trackedActors.forEach(Lang.bind(this, this._updateActorVisibility));
+ this._trackedActors.forEach(this._updateActorVisibility.bind(this));
},
getWorkAreaForMonitor(monitorIndex) {
if (!this._updateRegionIdle)
this._updateRegionIdle = Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
- Lang.bind(this, this._updateRegions));
+ this._updateRegions.bind(this));
},
_getWindowActorsForWorkspace(workspace) {
HOT_CORNER_PRESSURE_TIMEOUT,
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW);
- this._pressureBarrier.connect('trigger', Lang.bind(this, this._toggleOverview));
+ this._pressureBarrier.connect('trigger', this._toggleOverview.bind(this));
// Cache the three ripples instead of dynamically creating and destroying them.
this._ripple1 = new St.BoxLayout({ style_class: 'ripple-box', opacity: 0, visible: false });
}
this.actor.connect('leave-event',
- Lang.bind(this, this._onEnvironsLeft));
+ this._onEnvironsLeft.bind(this));
this._corner.connect('enter-event',
- Lang.bind(this, this._onCornerEntered));
+ this._onCornerEntered.bind(this));
this._corner.connect('leave-event',
- Lang.bind(this, this._onCornerLeft));
+ this._onCornerLeft.bind(this));
}
},
},
addBarrier(barrier) {
- barrier._pressureHitId = barrier.connect('hit', Lang.bind(this, this._onBarrierHit));
- barrier._pressureLeftId = barrier.connect('left', Lang.bind(this, this._onBarrierLeft));
+ barrier._pressureHitId = barrier.connect('hit', this._onBarrierHit.bind(this));
+ barrier._pressureLeftId = barrier.connect('left', this._onBarrierLeft.bind(this));
this._barriers.push(barrier);
},
},
destroy() {
- this._barriers.forEach(Lang.bind(this, this._disconnectBarrier));
+ this._barriers.forEach(this._disconnectBarrier.bind(this));
this._barriers = [];
},
this.actor.hide();
this.shown = false;
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
if (params.width && params.height) {
this.actor.width = params.width;
this.actor.add_constraint(constraint);
}
- this._actorAddedSignalId = container.connect('actor-added', Lang.bind(this, this._actorAdded));
- this._actorRemovedSignalId = container.connect('actor-removed', Lang.bind(this, this._actorRemoved));
+ this._actorAddedSignalId = container.connect('actor-added', this._actorAdded.bind(this));
+ this._actorRemovedSignalId = container.connect('actor-removed', this._actorRemoved.bind(this));
this._highlighted = null;
},
* in the shell core code too. */
'const stage = global.stage; ' +
/* Special lookingGlass functions */
- 'const inspect = Lang.bind(Main.lookingGlass, Main.lookingGlass.inspect); ' +
+ 'const inspect = Main.lookingGlass.inspect.bind(Main.lookingGlass); ' +
'const it = Main.lookingGlass.getIt(); ' +
- 'const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); ';
+ 'const r = Main.lookingGlass.getResult.bind(Main.lookingGlass); ';
const HISTORY_KEY = 'looking-glass-history';
// Time between tabs for them to count as a double-tab event
_init(entry) {
this._entry = entry;
- this._entry.connect('key-press-event', Lang.bind(this, this._entryKeyPressEvent));
+ this._entry.connect('key-press-event', this._entryKeyPressEvent.bind(this));
this._lastTabTime = global.get_current_time();
},
style_class: 'shell-link',
label: text });
this.actor.get_child().single_line_mode = true;
- this.actor.connect('clicked', Lang.bind(this, this._onClicked));
+ this.actor.connect('clicked', this._onClicked.bind(this));
this._lookingGlass = lookingGlass;
},
_init(lookingGlass) {
this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
let tracker = Shell.WindowTracker.get_default();
- this._updateId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._updateWindowList));
- global.display.connect('window-created', Lang.bind(this, this._updateWindowList));
- tracker.connect('tracked-windows-changed', Lang.bind(this, this._updateWindowList));
+ this._updateId = Main.initializeDeferredWork(this.actor, this._updateWindowList.bind(this));
+ global.display.connect('window-created', this._updateWindowList.bind(this));
+ tracker.connect('tracked-windows-changed', this._updateWindowList.bind(this));
this._lookingGlass = lookingGlass;
},
let metaWindow = windows[i].metaWindow;
// Avoid multiple connections
if (!metaWindow._lookingGlassManaged) {
- metaWindow.connect('unmanaged', Lang.bind(this, this._updateWindowList));
+ metaWindow.connect('unmanaged', this._updateWindowList.bind(this));
metaWindow._lookingGlassManaged = true;
}
let box = new St.BoxLayout({ vertical: true });
label.single_line_mode = true;
hbox.add(label, { expand: true, y_fill: false });
let button = new St.Button({ label: 'Insert', style_class: 'lg-obj-inspector-button' });
- button.connect('clicked', Lang.bind(this, this._onInsert));
+ button.connect('clicked', this._onInsert.bind(this));
hbox.add(button);
if (this._previousObj != null) {
button = new St.Button({ label: 'Back', style_class: 'lg-obj-inspector-button' });
- button.connect('clicked', Lang.bind(this, this._onBack));
+ button.connect('clicked', this._onBack.bind(this));
hbox.add(button);
}
button = new St.Button({ style_class: 'window-close' });
- button.connect('clicked', Lang.bind(this, this.close));
+ button.connect('clicked', this.close.bind(this));
hbox.add(button);
if (typeof(obj) == typeof({})) {
let properties = [];
_init(lookingGlass) {
let container = new Shell.GenericContainer({ width: 0,
height: 0 });
- container.connect('allocate', Lang.bind(this, this._allocate));
+ container.connect('allocate', this._allocate.bind(this));
Main.uiGroup.add_actor(container);
let eventHandler = new St.BoxLayout({ name: 'LookingGlassDialog',
this._displayText = new St.Label();
eventHandler.add(this._displayText, { expand: true });
- eventHandler.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
- eventHandler.connect('button-press-event', Lang.bind(this, this._onButtonPressEvent));
- eventHandler.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
- eventHandler.connect('motion-event', Lang.bind(this, this._onMotionEvent));
+ eventHandler.connect('key-press-event', this._onKeyPressEvent.bind(this));
+ eventHandler.connect('button-press-event', this._onButtonPressEvent.bind(this));
+ eventHandler.connect('scroll-event', this._onScrollEvent.bind(this));
+ eventHandler.connect('motion-event', this._onMotionEvent.bind(this));
Clutter.grab_pointer(eventHandler);
Clutter.grab_keyboard(eventHandler);
this._loadExtension(null, uuid);
ExtensionSystem.connect('extension-loaded',
- Lang.bind(this, this._loadExtension));
+ this._loadExtension.bind(this));
},
_loadExtension(o, uuid) {
style_class: 'shell-link',
label: _("View Source") });
viewsource._extension = extension;
- viewsource.connect('clicked', Lang.bind(this, this._onViewSource));
+ viewsource.connect('clicked', this._onViewSource.bind(this));
metaBox.add(viewsource);
if (extension.metadata.url) {
style_class: 'shell-link',
label: _("Web Page") });
webpage._extension = extension;
- webpage.connect('clicked', Lang.bind(this, this._onWebPage));
+ webpage.connect('clicked', this._onWebPage.bind(this));
metaBox.add(webpage);
}
viewerrors._extension = extension;
viewerrors._parentBox = box;
viewerrors._isShowing = false;
- viewerrors.connect('clicked', Lang.bind(this, this._onViewErrors));
+ viewerrors.connect('clicked', this._onViewErrors.bind(this));
metaBox.add(viewerrors);
return box;
vertical: true,
visible: false,
reactive: true });
- this.actor.connect('key-press-event', Lang.bind(this, this._globalKeyPressEvent));
+ this.actor.connect('key-press-event', this._globalKeyPressEvent.bind(this));
this._interfaceSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
this._interfaceSettings.connect('changed::monospace-font-name',
- Lang.bind(this, this._updateFont));
+ this._updateFont.bind(this));
this._updateFont();
// We want it to appear to slide out from underneath the panel
Main.uiGroup.set_child_below_sibling(this.actor,
Main.layoutManager.panelBox);
Main.layoutManager.panelBox.connect('allocation-changed',
- Lang.bind(this, this._queueResize));
+ this._queueResize.bind(this));
Main.layoutManager.keyboardBox.connect('allocation-changed',
- Lang.bind(this, this._queueResize));
+ this._queueResize.bind(this));
this._objInspector = new ObjInspector(this);
Main.uiGroup.add_actor(this._objInspector.actor);
let showAtLaunch = this._settingsInit(aZoomRegion);
aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse);
- cursorTracker.connect('cursor-changed', Lang.bind(this, this._updateMouseSprite));
+ cursorTracker.connect('cursor-changed', this._updateMouseSprite.bind(this));
this._cursorTracker = cursorTracker;
// Export to dbus.
*/
startTrackingMouse() {
if (!this._pointerWatch)
- this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(MOUSE_POLL_FREQUENCY, Lang.bind(this, this.scrollToMousePos));
+ this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(MOUSE_POLL_FREQUENCY, this.scrollToMousePos.bind(this));
},
/**
});
this._settings.connect('changed::' + SCREEN_POSITION_KEY,
- Lang.bind(this, this._updateScreenPosition));
+ this._updateScreenPosition.bind(this));
this._settings.connect('changed::' + MAG_FACTOR_KEY,
- Lang.bind(this, this._updateMagFactor));
+ this._updateMagFactor.bind(this));
this._settings.connect('changed::' + LENS_MODE_KEY,
- Lang.bind(this, this._updateLensMode));
+ this._updateLensMode.bind(this));
this._settings.connect('changed::' + CLAMP_MODE_KEY,
- Lang.bind(this, this._updateClampMode));
+ this._updateClampMode.bind(this));
this._settings.connect('changed::' + MOUSE_TRACKING_KEY,
- Lang.bind(this, this._updateMouseTrackingMode));
+ this._updateMouseTrackingMode.bind(this));
this._settings.connect('changed::' + FOCUS_TRACKING_KEY,
- Lang.bind(this, this._updateFocusTrackingMode));
+ this._updateFocusTrackingMode.bind(this));
this._settings.connect('changed::' + CARET_TRACKING_KEY,
- Lang.bind(this, this._updateCaretTrackingMode));
+ this._updateCaretTrackingMode.bind(this));
this._settings.connect('changed::' + INVERT_LIGHTNESS_KEY,
- Lang.bind(this, this._updateInvertLightness));
+ this._updateInvertLightness.bind(this));
this._settings.connect('changed::' + COLOR_SATURATION_KEY,
- Lang.bind(this, this._updateColorSaturation));
+ this._updateColorSaturation.bind(this));
this._settings.connect('changed::' + BRIGHT_RED_KEY,
- Lang.bind(this, this._updateBrightness));
+ this._updateBrightness.bind(this));
this._settings.connect('changed::' + BRIGHT_GREEN_KEY,
- Lang.bind(this, this._updateBrightness));
+ this._updateBrightness.bind(this));
this._settings.connect('changed::' + BRIGHT_BLUE_KEY,
- Lang.bind(this, this._updateBrightness));
+ this._updateBrightness.bind(this));
this._settings.connect('changed::' + CONTRAST_RED_KEY,
- Lang.bind(this, this._updateContrast));
+ this._updateContrast.bind(this));
this._settings.connect('changed::' + CONTRAST_GREEN_KEY,
- Lang.bind(this, this._updateContrast));
+ this._updateContrast.bind(this));
this._settings.connect('changed::' + CONTRAST_BLUE_KEY,
- Lang.bind(this, this._updateContrast));
+ this._updateContrast.bind(this));
this._settings.connect('changed::' + SHOW_CROSS_HAIRS_KEY, () => {
this.setCrosshairsVisible(this._settings.get_boolean(SHOW_CROSS_HAIRS_KEY));
this._scrollContentsTimerId = 0;
Main.layoutManager.connect('monitors-changed',
- Lang.bind(this, this._monitorsChanged));
+ this._monitorsChanged.bind(this));
this._focusCaretTracker.connect('caret-moved',
- Lang.bind(this, this._updateCaret));
+ this._updateCaret.bind(this));
this._focusCaretTracker.connect('focus-changed',
- Lang.bind(this, this._updateFocus));
+ this._updateFocus.bind(this));
},
_updateFocus(caller, event) {
this.reCenter();
Main.layoutManager.connect('monitors-changed',
- Lang.bind(this, this._monitorsChanged));
+ this._monitorsChanged.bind(this));
},
_monitorsChanged() {
wm.setCustomKeybindingHandler('panel-main-menu',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- sessionMode.hasOverview ? Lang.bind(overview, overview.toggle) : null);
+ sessionMode.hasOverview ? overview.toggle.bind(overview) : null);
wm.allowKeybinding('overlay-key', Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW);
can_focus: true,
x_expand: true, x_fill: true });
this.actor.connect('key-press-event',
- Lang.bind(this, this._onKeyPressed));
+ this._onKeyPressed.bind(this));
let vbox = new St.BoxLayout({ vertical: true });
this.actor.set_child(vbox);
this._bodyStack.add_actor(this.bodyLabel.actor);
this.setBody(body);
- this._closeButton.connect('clicked', Lang.bind(this, this.close));
- this.actor.connect('notify::hover', Lang.bind(this, this._sync));
- this.actor.connect('clicked', Lang.bind(this, this._onClicked));
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this._closeButton.connect('clicked', this.close.bind(this));
+ this.actor.connect('notify::hover', this._sync.bind(this));
+ this.actor.connect('clicked', this._onClicked.bind(this));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._sync();
},
vertical: true });
this.actor.add_actor(this._list);
- this._list.connect('actor-added', Lang.bind(this, this._sync));
- this._list.connect('actor-removed', Lang.bind(this, this._sync));
+ this._list.connect('actor-added', this._sync.bind(this));
+ this._list.connect('actor-removed', this._sync.bind(this));
let id = Main.sessionMode.connect('updated',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
this.actor.connect('destroy', () => {
Main.sessionMode.disconnect(id);
});
pivot_point: pivot,
scale_x: scale, scale_y: scale });
obj.keyFocusId = message.actor.connect('key-focus-in',
- Lang.bind(this, this._onKeyFocusIn));
+ this._onKeyFocusIn.bind(this));
obj.destroyId = message.actor.connect('destroy', () => {
this.removeMessage(message, false);
});
this._prevKeyFocusActor = global.stage.get_key_focus();
- this._focusActorChangedId = global.stage.connect('notify::key-focus', Lang.bind(this, this._focusActorChanged));
+ this._focusActorChangedId = global.stage.connect('notify::key-focus', this._focusActorChanged.bind(this));
if (!this._actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false))
this._actor.grab_key_focus();
this.id = 'generic';
this._masterSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications' });
- this._masterSettings.connect('changed', Lang.bind(this, this._changed));
+ this._masterSettings.connect('changed', this._changed.bind(this));
},
store() { },
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications.application',
path: '/org/gnome/desktop/notifications/application/' + this._canonicalId + '/' });
- this._masterSettings.connect('changed', Lang.bind(this, this._changed));
- this._settings.connect('changed', Lang.bind(this, this._changed));
+ this._masterSettings.connect('changed', this._changed.bind(this));
+ this._settings.connect('changed', this._changed.bind(this));
},
store() {
this._size = size;
this.actor = new Shell.GenericContainer();
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocate));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocate.bind(this));
this.actor.connect('destroy', () => {
this._source.disconnect(this._iconUpdatedId);
this._actorDestroyed = true;
this.actor.add_actor(this._iconBin);
- this._iconUpdatedId = this._source.connect('icon-updated', Lang.bind(this, this._updateIcon));
+ this._iconUpdatedId = this._source.connect('icon-updated', this._updateIcon.bind(this));
this._updateIcon();
},
this.actor.add_actor(this._counterBin);
- this._countUpdatedId = this._source.connect('count-updated', Lang.bind(this, this._updateCount));
+ this._countUpdatedId = this._source.connect('count-updated', this._updateCount.bind(this));
this._updateCount();
this.actor.connect('destroy', () => {
while (this.notifications.length >= MAX_NOTIFICATIONS_PER_SOURCE)
this.notifications.shift().destroy(NotificationDestroyedReason.EXPIRED);
- notification.connect('destroy', Lang.bind(this, this._onNotificationDestroy));
- notification.connect('acknowledged-changed', Lang.bind(this, this.countUpdated));
+ notification.connect('destroy', this._onNotificationDestroy.bind(this));
+ notification.connect('acknowledged-changed', this.countUpdated.bind(this));
this.notifications.push(notification);
this.emit('notification-added', notification);
x_expand: true,
layout_manager: new Clutter.BinLayout() });
this._bannerBin.connect('key-release-event',
- Lang.bind(this, this._onNotificationKeyRelease));
+ this._onNotificationKeyRelease.bind(this));
this._bannerBin.connect('notify::hover',
- Lang.bind(this, this._onNotificationHoverChanged));
+ this._onNotificationHoverChanged.bind(this));
this.actor.add_actor(this._bannerBin);
this._notificationFocusGrabber = new FocusGrabber(this._bannerBin);
Main.layoutManager.addChrome(this.actor, { affectsInputRegion: false });
Main.layoutManager.trackChrome(this._bannerBin, { affectsInputRegion: true });
- global.screen.connect('in-fullscreen-changed', Lang.bind(this, this._updateState));
+ global.screen.connect('in-fullscreen-changed', this._updateState.bind(this));
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
Main.overview.connect('window-drag-begin',
- Lang.bind(this, this._onDragBegin));
+ this._onDragBegin.bind(this));
Main.overview.connect('window-drag-cancelled',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.overview.connect('window-drag-end',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.overview.connect('item-drag-begin',
- Lang.bind(this, this._onDragBegin));
+ this._onDragBegin.bind(this));
Main.overview.connect('item-drag-cancelled',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.overview.connect('item-drag-end',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.xdndHandler.connect('drag-begin',
- Lang.bind(this, this._onDragBegin));
+ this._onDragBegin.bind(this));
Main.xdndHandler.connect('drag-end',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.wm.addKeybinding('focus-active-notification',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._expandActiveNotification));
+ this._expandActiveNotification.bind(this));
this._sources = new Map();
// Register that we got a notification for this source
source.policy.store();
- source.policy.connect('enable-changed', Lang.bind(this, this._onSourceEnableChanged, source));
- source.policy.connect('policy-changed', Lang.bind(this, this._updateState));
+ source.policy.connect('enable-changed', () => {
+ this._onSourceEnableChanged(source.policy, source);
+ });
+ source.policy.connect('policy-changed', this._updateState.bind(this));
this._onSourceEnableChanged(source.policy, source);
},
this._sources.set(source, obj);
- obj.notifyId = source.connect('notify', Lang.bind(this, this._onNotify));
- obj.destroyId = source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
+ obj.notifyId = source.connect('notify', this._onNotify.bind(this));
+ obj.destroyId = source.connect('destroy', this._onSourceDestroy.bind(this));
this.emit('source-added', source);
},
let full = (this.queueCount + bannerCount >= MAX_NOTIFICATIONS_IN_QUEUE);
if (!full || notification.urgency == Urgency.CRITICAL) {
notification.connect('destroy',
- Lang.bind(this, this._onNotificationDestroy));
+ this._onNotificationDestroy.bind(this));
this._notificationQueue.push(notification);
this._notificationQueue.sort(
(n1, n2) => n2.urgency - n1.urgency
// We wait for a longer period if the notification popped up where the mouse pointer was already positioned.
// That gives the user more time to mouse away from the notification and mouse back in in order to expand it.
let timeout = this._useLongerNotificationLeftTimeout ? LONGER_HIDE_TIMEOUT * 1000 : HIDE_TIMEOUT * 1000;
- this._notificationLeftTimeoutId = Mainloop.timeout_add(timeout, Lang.bind(this, this._onNotificationLeftTimeout));
+ this._notificationLeftTimeoutId = Mainloop.timeout_add(timeout, this._onNotificationLeftTimeout.bind(this));
GLib.Source.set_name_by_id(this._notificationLeftTimeoutId, '[gnome-shell] this._onNotificationLeftTimeout');
}
},
x > this._notificationLeftMouseX - MOUSE_LEFT_ACTOR_THRESHOLD) {
this._notificationLeftMouseX = -1;
this._notificationLeftTimeoutId = Mainloop.timeout_add(LONGER_HIDE_TIMEOUT * 1000,
- Lang.bind(this, this._onNotificationLeftTimeout));
+ this._onNotificationLeftTimeout.bind(this));
GLib.Source.set_name_by_id(this._notificationLeftTimeoutId, '[gnome-shell] this._onNotificationLeftTimeout');
} else {
this._notificationLeftTimeoutId = 0;
if (!this._userActiveWhileNotificationShown) {
// If the user isn't active, set up a watch to let us know
// when the user becomes active.
- this.idleMonitor.add_user_active_watch(Lang.bind(this, this._onIdleMonitorBecameActive));
+ this.idleMonitor.add_user_active_watch(this._onIdleMonitorBecameActive.bind(this));
}
this._banner = this._notification.createBanner();
this._bannerClickedId = this._banner.connect('done-displaying',
- Lang.bind(this, this._escapeTray));
+ this._escapeTray.bind(this));
this._bannerUnfocusedId = this._banner.connect('unfocused', () => {
this._updateState();
});
if (timeout > 0) {
this._notificationTimeoutId =
Mainloop.timeout_add(timeout,
- Lang.bind(this, this._notificationTimeout));
+ this._notificationTimeout.bind(this));
GLib.Source.set_name_by_id(this._notificationTimeoutId, '[gnome-shell] this._notificationTimeout');
}
},
coordinate: Clutter.BindCoordinate.ALL });
this._group.add_constraint(constraint);
- this._group.connect('destroy', Lang.bind(this, this._onGroupDestroy));
+ this._group.connect('destroy', this._onGroupDestroy.bind(this));
this.backgroundStack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
this._backgroundBin = new St.Bin({ child: this.backgroundStack,
{ opacity: 0,
time: OPEN_AND_CLOSE_TIME,
transition: 'easeOutQuad',
- onComplete: Lang.bind(this,
- this._closeComplete)
+ onComplete: this._closeComplete.bind(this)
})
else
this._closeComplete();
this._player.next();
});
- this._player.connect('changed', Lang.bind(this, this._update));
- this._player.connect('closed', Lang.bind(this, this.close));
+ this._player.connect('changed', this._update.bind(this));
+ this._player.connect('closed', this.close.bind(this));
this._update();
},
_init(busName) {
this._mprisProxy = new MprisProxy(Gio.DBus.session, busName,
'/org/mpris/MediaPlayer2',
- Lang.bind(this, this._onMprisProxyReady));
+ this._onMprisProxyReady.bind(this));
this._playerProxy = new MprisPlayerProxy(Gio.DBus.session, busName,
'/org/mpris/MediaPlayer2',
- Lang.bind(this, this._onPlayerProxyReady));
+ this._onPlayerProxyReady.bind(this));
this._visible = false;
this._trackArtists = [];
_onPlayerProxyReady() {
this._propsChangedId = this._playerProxy.connect('g-properties-changed',
- Lang.bind(this, this._updateState));
+ this._updateState.bind(this));
this._updateState();
},
this._proxy = new DBusProxy(Gio.DBus.session,
'org.freedesktop.DBus',
'/org/freedesktop/DBus',
- Lang.bind(this, this._onProxyReady));
+ this._onProxyReady.bind(this));
},
_shouldShow() {
});
});
this._proxy.connectSignal('NameOwnerChanged',
- Lang.bind(this, this._onNameOwnerChanged));
+ this._onNameOwnerChanged.bind(this));
},
_onNameOwnerChanged(proxy, sender, [name, oldOwner, newOwner]) {
this._nextNotificationId = 1;
Shell.WindowTracker.get_default().connect('notify::focus-app',
- Lang.bind(this, this._onFocusAppChanged));
+ this._onFocusAppChanged.bind(this));
Main.overview.connect('hidden',
- Lang.bind(this, this._onFocusAppChanged));
+ this._onFocusAppChanged.bind(this));
},
_imageForNotificationData(hints) {
this._nameWatcherId = Gio.DBus.session.watch_name(sender,
Gio.BusNameWatcherFlags.NONE,
null,
- Lang.bind(this, this._onNameVanished));
+ this._onNameVanished.bind(this));
else
this._nameWatcherId = 0;
},
if (buttons) {
buttons.deep_unpack().forEach(button => {
- this.addAction(button.label.unpack(),
- Lang.bind(this, this._onButtonClicked, button));
+ this.addAction(button.label.unpack(), () => {
+ this._onButtonClicked(button);
+ });
});
}
delete this._sources[appId];
this._saveNotifications();
});
- source.connect('count-updated', Lang.bind(this, this._saveNotifications));
+ source.connect('count-updated', this._saveNotifications.bind(this));
Main.messageTray.add(source);
this._sources[appId] = source;
return source;
this._osdLabels = [];
this._monitorLabels = null;
Main.layoutManager.connect('monitors-changed',
- Lang.bind(this, this._reset));
+ this._reset.bind(this));
this._reset();
},
this._reset();
Main.layoutManager.connect('monitors-changed',
- Lang.bind(this, this._relayout));
+ this._relayout.bind(this));
let themeContext = St.ThemeContext.get_for_stage(global.stage);
themeContext.connect('notify::scale-factor',
- Lang.bind(this, this._relayout));
+ this._relayout.bind(this));
this._relayout();
Main.uiGroup.add_child(this.actor);
},
if (this._hideTimeoutId)
Mainloop.source_remove(this._hideTimeoutId);
this._hideTimeoutId = Mainloop.timeout_add(HIDE_TIMEOUT,
- Lang.bind(this, this._hide));
+ this._hide.bind(this));
GLib.Source.set_name_by_id(this._hideTimeoutId, '[gnome-shell] this._hide');
},
_init() {
this._osdWindows = [];
Main.layoutManager.connect('monitors-changed',
- Lang.bind(this, this._monitorsChanged));
+ this._monitorsChanged.bind(this));
this._monitorsChanged();
},
this._undoCallback = undoCallback;
if (undoCallback)
- notification.addAction(_("Undo"), Lang.bind(this, this._onUndoClicked));
+ notification.addAction(_("Undo"), this._onUndoClicked.bind(this));
this._source.notify(notification);
}
this._overviewCreated = false;
this._initCalled = false;
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
},
// XDND
this._dragMonitor = {
- dragMotion: Lang.bind(this, this._onDragMotion)
+ dragMotion: this._onDragMotion.bind(this)
};
Main.layoutManager.overviewGroup.connect('scroll-event',
- Lang.bind(this, this._onScrollEvent));
- Main.xdndHandler.connect('drag-begin', Lang.bind(this, this._onDragBegin));
- Main.xdndHandler.connect('drag-end', Lang.bind(this, this._onDragEnd));
+ this._onScrollEvent.bind(this));
+ Main.xdndHandler.connect('drag-begin', this._onDragBegin.bind(this));
+ Main.xdndHandler.connect('drag-end', this._onDragEnd.bind(this));
- global.screen.connect('restacked', Lang.bind(this, this._onRestacked));
+ global.screen.connect('restacked', this._onRestacked.bind(this));
this._windowSwitchTimeoutId = 0;
this._windowSwitchTimestamp = 0;
this.dashIconSize = this._dash.iconSize;
});
- Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
+ Main.layoutManager.connect('monitors-changed', this._relayout.bind(this));
this._relayout();
},
style_class: 'overview-controls',
clip_to_allocation: true });
- Main.overview.connect('hiding', Lang.bind(this, this._onOverviewHiding));
+ Main.overview.connect('hiding', this._onOverviewHiding.bind(this));
- Main.overview.connect('item-drag-begin', Lang.bind(this, this._onDragBegin));
- Main.overview.connect('item-drag-end', Lang.bind(this, this._onDragEnd));
- Main.overview.connect('item-drag-cancelled', Lang.bind(this, this._onDragEnd));
+ Main.overview.connect('item-drag-begin', this._onDragBegin.bind(this));
+ Main.overview.connect('item-drag-end', this._onDragEnd.bind(this));
+ Main.overview.connect('item-drag-cancelled', this._onDragEnd.bind(this));
- Main.overview.connect('window-drag-begin', Lang.bind(this, this._onWindowDragBegin));
- Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onWindowDragEnd));
- Main.overview.connect('window-drag-end', Lang.bind(this, this._onWindowDragEnd));
+ Main.overview.connect('window-drag-begin', this._onWindowDragBegin.bind(this));
+ Main.overview.connect('window-drag-cancelled', this._onWindowDragEnd.bind(this));
+ Main.overview.connect('window-drag-end', this._onWindowDragEnd.bind(this));
},
_getSlide() {
this.actor.track_hover = true;
this.actor.add_actor(this._thumbnailsBox.actor);
- Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._updateSlide));
- this.actor.connect('notify::hover', Lang.bind(this, this._updateSlide));
+ Main.layoutManager.connect('monitors-changed', this._updateSlide.bind(this));
+ this.actor.connect('notify::hover', this._updateSlide.bind(this));
this._thumbnailsBox.actor.bind_property('visible', this.actor, 'visible', GObject.BindingFlags.SYNC_CREATE);
},
this.actor.add_actor(this._dash.actor);
- this._dash.connect('icon-size-changed', Lang.bind(this, this._updateSlide));
+ this._dash.connect('icon-size-changed', this._updateSlide.bind(this));
},
_getSlide() {
this.viewSelector = new ViewSelector.ViewSelector(searchEntry,
this.dash.showAppsButton);
- this.viewSelector.connect('page-changed', Lang.bind(this, this._setVisibility));
- this.viewSelector.connect('page-empty', Lang.bind(this, this._onPageEmpty));
+ this.viewSelector.connect('page-changed', this._setVisibility.bind(this));
+ this.viewSelector.connect('page-empty', this._onPageEmpty.bind(this));
let layout = new ControlsLayout();
this.actor = new St.Widget({ layout_manager: layout,
expand: true });
this._group.add_actor(this._thumbnailsSlider.actor);
- layout.connect('allocation-changed', Lang.bind(this, this._updateWorkspacesGeometry));
+ layout.connect('allocation-changed', this._updateWorkspacesGeometry.bind(this));
- Main.overview.connect('showing', Lang.bind(this, this._updateSpacerVisibility));
+ Main.overview.connect('showing', this._updateSpacerVisibility.bind(this));
Main.overview.connect('item-drag-begin', () => {
let activePage = this.viewSelector.getActivePage();
if (activePage != ViewSelector.ViewPage.WINDOWS)
this.actor.set_child(arrow);
this._ensureMenu(groupDevices);
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('clicked', actor => {
if (actor.get_checked()) {
if (this._padChooserMenu != null)
_init() {
this.actor = new St.Entry({ hint_text: _("New shortcut…"),
style: 'width: 10em' });
- this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
+ this.actor.connect('captured-event', this._onCapturedEvent.bind(this));
},
_onCapturedEvent(actor, event) {
_init() {
this.actor = new St.Button({ style_class: 'button' });
- this.actor.connect('clicked', Lang.bind(this, this._onButtonClicked));
+ this.actor.connect('clicked', this._onButtonClicked.bind(this));
this.actor.set_toggle_mode(true);
let boxLayout = new Clutter.BoxLayout({ orientation: Clutter.Orientation.HORIZONTAL,
this.actor = new St.Widget({ layout_manager: boxLayout });
this._actionComboBox = new ActionComboBox();
- this._actionComboBox.connect('action-selected', Lang.bind(this, this._onActionSelected));
+ this._actionComboBox.connect('action-selected', this._onActionSelected.bind(this));
this.actor.add_actor(this._actionComboBox.actor);
this._keybindingEdit = new KeybindingEntry();
- this._keybindingEdit.connect('keybinding-edited', Lang.bind(this, this._onKeybindingEdited));
+ this._keybindingEdit.connect('keybinding-edited', this._onKeybindingEdited.bind(this));
this.actor.add_actor(this._keybindingEdit.actor);
this._doneButton = new St.Button({ label: _("Done"),
style_class: 'button',
x_expand: false});
- this._doneButton.connect('clicked', Lang.bind(this, this._onEditingDone));
+ this._doneButton.connect('clicked', this._onEditingDone.bind(this));
this.actor.add_actor(this._doneButton);
},
this._settings = settings;
this._imagePath = imagePath;
this._editionMode = editionMode;
- this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
+ this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
this._padChooser = null;
let deviceManager = Clutter.DeviceManager.get_default();
y_expand: true,
vertical: true,
reactive: true });
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
Main.uiGroup.add_actor(this.actor);
this._monitorIndex = monitorIndex;
this._updatePadChooser();
this._actionEditor = new ActionEditor();
- this._actionEditor.connect('done', Lang.bind(this, this._endActionEdition));
+ this._actionEditor.connect('done', this._endActionEdition.bind(this));
this._padDiagram = new PadDiagram({ image: this._imagePath,
left_handed: settings.get_boolean('left-handed'),
this._busyNotifyId = 0;
let bin = new St.Bin({ name: 'appMenu' });
- bin.connect('style-changed', Lang.bind(this, this._onStyleChanged));
+ bin.connect('style-changed', this._onStyleChanged.bind(this));
this.actor.add_actor(bin);
this.actor.bind_property("reactive", this.actor, "can-focus", 0);
let textureCache = St.TextureCache.get_default();
textureCache.connect('icon-theme-changed',
- Lang.bind(this, this._onIconThemeChanged));
+ this._onIconThemeChanged.bind(this));
this._iconBox = new St.Bin({ style_class: 'app-menu-icon' });
this._container.add_actor(this._iconBox);
!Main.overview.visible;
if (!this._visible)
this.actor.hide();
- this._overviewHidingId = Main.overview.connect('hiding', Lang.bind(this, this._sync));
- this._overviewShowingId = Main.overview.connect('showing', Lang.bind(this, this._sync));
+ this._overviewHidingId = Main.overview.connect('hiding', this._sync.bind(this));
+ this._overviewShowingId = Main.overview.connect('showing', this._sync.bind(this));
this._showsAppMenuId = this._gtkSettings.connect('notify::gtk-shell-shows-app-menu',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
this._stop = true;
let tracker = Shell.WindowTracker.get_default();
let appSys = Shell.AppSystem.get_default();
this._focusAppNotifyId =
- tracker.connect('notify::focus-app', Lang.bind(this, this._focusAppChanged));
+ tracker.connect('notify::focus-app', this._focusAppChanged.bind(this));
this._appStateChangedSignalId =
- appSys.connect('app-state-changed', Lang.bind(this, this._onAppStateChanged));
+ appSys.connect('app-state-changed', this._onAppStateChanged.bind(this));
this._switchWorkspaceNotifyId =
- global.window_manager.connect('switch-workspace', Lang.bind(this, this._sync));
+ global.window_manager.connect('switch-workspace', this._sync.bind(this));
this._sync();
},
this._targetApp = targetApp;
if (this._targetApp) {
- this._appMenuNotifyId = this._targetApp.connect('notify::menu', Lang.bind(this, this._sync));
- this._actionGroupNotifyId = this._targetApp.connect('notify::action-group', Lang.bind(this, this._sync));
- this._busyNotifyId = this._targetApp.connect('notify::busy', Lang.bind(this, this._sync));
+ this._appMenuNotifyId = this._targetApp.connect('notify::menu', this._sync.bind(this));
+ this._actionGroupNotifyId = this._targetApp.connect('notify::action-group', this._sync.bind(this));
+ this._busyNotifyId = this._targetApp.connect('notify::busy', this._sync.bind(this));
this._label.set_text(this._targetApp.get_name());
this.actor.set_accessible_name(this._targetApp.get_name());
}
this.actor.label_actor = this._label;
- this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
- this.actor.connect_after('key-release-event', Lang.bind(this, this._onKeyRelease));
+ this.actor.connect('captured-event', this._onCapturedEvent.bind(this));
+ this.actor.connect_after('key-release-event', this._onKeyRelease.bind(this));
Main.overview.connect('showing', () => {
this.actor.add_style_pseudo_class('overview');
if (this._xdndTimeOut != 0)
Mainloop.source_remove(this._xdndTimeOut);
- this._xdndTimeOut = Mainloop.timeout_add(BUTTON_DND_ACTIVATION_TIMEOUT,
- Lang.bind(this, this._xdndToggleOverview, actor));
+ this._xdndTimeOut = Mainloop.timeout_add(BUTTON_DND_ACTIVATION_TIMEOUT, () => {
+ this._xdndToggleOverview(actor);
+ });
GLib.Source.set_name_by_id(this._xdndTimeOut, '[gnome-shell] this._xdndToggleOverview');
return DND.DragMotionResult.CONTINUE;
this._side = side;
this.actor = new St.DrawingArea({ style_class: 'panel-corner' });
- this.actor.connect('style-changed', Lang.bind(this, this._styleChanged));
- this.actor.connect('repaint', Lang.bind(this, this._repaint));
+ this.actor.connect('style-changed', this._styleChanged.bind(this));
+ this.actor.connect('repaint', this._repaint.bind(this));
},
_findRightmostButton(container) {
this._rightCorner = new PanelCorner(St.Side.RIGHT);
this.actor.add_actor(this._rightCorner.actor);
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocate));
- this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
- this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocate.bind(this));
+ this.actor.connect('button-press-event', this._onButtonPress.bind(this));
+ this.actor.connect('key-press-event', this._onKeyPress.bind(this));
Main.overview.connect('showing', () => {
this.actor.add_style_pseudo_class('overview');
Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'focus-top-bar-symbolic',
{ sortGroup: CtrlAltTab.SortGroup.TOP });
- Main.sessionMode.connect('updated', Lang.bind(this, this._updatePanel));
+ Main.sessionMode.connect('updated', this._updatePanel.bind(this));
this._trackedWindows = new Map();
- global.window_group.connect('actor-added', Lang.bind(this, this._onWindowActorAdded));
- global.window_group.connect('actor-removed', Lang.bind(this, this._onWindowActorRemoved));
- global.window_manager.connect('switch-workspace', Lang.bind(this, this._updateSolidStyle));
+ global.window_group.connect('actor-added', this._onWindowActorAdded.bind(this));
+ global.window_group.connect('actor-removed', this._onWindowActorRemoved.bind(this));
+ global.window_manager.connect('switch-workspace', this._updateSolidStyle.bind(this));
global.screen.connect('workareas-changed', () => { this.actor.queue_relayout(); });
this._updatePanel();
_onWindowActorAdded(container, metaWindowActor) {
let signalIds = [];
['allocation-changed', 'notify::visible'].forEach(s => {
- signalIds.push(metaWindowActor.connect(s, Lang.bind(this, this._updateSolidStyle)));
+ signalIds.push(metaWindowActor.connect(s, this._updateSolidStyle.bind(this)));
});
this._trackedWindows.set(metaWindowActor, signalIds);
},
emitter.disconnect(destroyId);
container.destroy();
});
- indicator.connect('menu-set', Lang.bind(this, this._onMenuSet));
+ indicator.connect('menu-set', this._onMenuSet.bind(this));
this._onMenuSet(indicator);
},
x_fill: true,
child: this.actor });
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocate));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocate.bind(this));
- this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
+ this.actor.connect('style-changed', this._onStyleChanged.bind(this));
this._minHPadding = this._natHPadding = 0.0;
},
accessible_name: nameText ? nameText : "",
accessible_role: Atk.Role.MENU });
- this.actor.connect('event', Lang.bind(this, this._onEvent));
- this.actor.connect('notify::visible', Lang.bind(this, this._onVisibilityChanged));
+ this.actor.connect('event', this._onEvent.bind(this));
+ this.actor.connect('notify::visible', this._onVisibilityChanged.bind(this));
if (dontCreateMenu)
this.menu = new PopupMenu.PopupDummyMenu(this.actor);
this.menu = menu;
if (this.menu) {
this.menu.actor.add_style_class_name('panel-menu');
- this.menu.connect('open-state-changed', Lang.bind(this, this._onOpenStateChanged));
- this.menu.actor.connect('key-press-event', Lang.bind(this, this._onMenuKeyPress));
+ this.menu.connect('open-state-changed', this._onOpenStateChanged.bind(this));
+ this.menu.actor.connect('key-press-event', this._onMenuKeyPress.bind(this));
Main.uiGroup.add_actor(this.menu.actor);
this.menu.actor.hide();
_addIndicator() {
let icon = new St.Icon({ style_class: 'system-status-icon' });
this.indicators.add_actor(icon);
- icon.connect('notify::visible', Lang.bind(this, this._syncIndicatorsVisible));
+ icon.connect('notify::visible', this._syncIndicatorsVisible.bind(this));
this._syncIndicatorsVisible();
return icon;
}
_init() {
this._idleMonitor = Meta.IdleMonitor.get_core();
- this._idleMonitor.add_idle_watch(IDLE_TIME, Lang.bind(this, this._onIdleMonitorBecameIdle));
+ this._idleMonitor.add_idle_watch(IDLE_TIME, this._onIdleMonitorBecameIdle.bind(this));
this._idle = this._idleMonitor.get_idletime() > IDLE_TIME;
this._watches = [];
this.pointerX = null;
_onIdleMonitorBecameIdle(monitor) {
this._idle = true;
- this._idleMonitor.add_user_active_watch(Lang.bind(this, this._onIdleMonitorBecameActive));
+ this._idleMonitor.add_user_active_watch(this._onIdleMonitorBecameActive.bind(this));
this._updateTimeout();
},
minInterval = Math.min(this._watches[i].interval, minInterval);
this._timeoutId = Mainloop.timeout_add(minInterval,
- Lang.bind(this, this._onTimeout));
+ this._onTimeout.bind(this));
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout');
},
this.actor.add_style_class_name(params.style_class);
if (this._activatable) {
- this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPressEvent));
- this.actor.connect('button-release-event', Lang.bind(this, this._onButtonReleaseEvent));
- this.actor.connect('touch-event', Lang.bind(this, this._onTouchEvent));
- this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
+ this.actor.connect('button-press-event', this._onButtonPressEvent.bind(this));
+ this.actor.connect('button-release-event', this._onButtonReleaseEvent.bind(this));
+ this.actor.connect('touch-event', this._onTouchEvent.bind(this));
+ this.actor.connect('key-press-event', this._onKeyPressEvent.bind(this));
}
if (params.reactive && params.hover)
- this.actor.connect('notify::hover', Lang.bind(this, this._onHoverChanged));
+ this.actor.connect('notify::hover', this._onHoverChanged.bind(this));
- this.actor.connect('key-focus-in', Lang.bind(this, this._onKeyFocusIn));
- this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('key-focus-in', this._onKeyFocusIn.bind(this));
+ this.actor.connect('key-focus-out', this._onKeyFocusOut.bind(this));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
},
_getTopMenu() {
this.actor.label_actor = this.label;
this.label.connect('notify::text',
- Lang.bind(this, this._syncVisibility));
+ this._syncVisibility.bind(this));
this._syncVisibility();
this._separator = new St.Widget({ style_class: 'popup-separator-menu-item',
this._sensitive = true;
- this._sessionUpdatedId = Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ this._sessionUpdatedId = Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
},
_getTopMenu() {
}
if (menuItem instanceof PopupMenuSection) {
- let activeChangeId = menuItem.connect('active-changed', Lang.bind(this, this._subMenuActiveChanged));
+ let activeChangeId = menuItem.connect('active-changed', this._subMenuActiveChanged.bind(this));
let parentOpenStateChangedId = this.connect('open-state-changed', (self, open) => {
if (open)
this.box.insert_child_below(menuItem.menu.actor, before_item);
this._connectItemSignals(menuItem);
- let subMenuActiveChangeId = menuItem.menu.connect('active-changed', Lang.bind(this, this._subMenuActiveChanged));
+ let subMenuActiveChangeId = menuItem.menu.connect('active-changed', this._subMenuActiveChanged.bind(this));
let closingId = this.connect('menu-closed', () => {
menuItem.menu.close(BoxPointer.PopupAnimation.NONE);
});
if (this.sourceActor)
this._keyPressId = this.sourceActor.connect('key-press-event',
- Lang.bind(this, this._onKeyPress));
+ this._onKeyPress.bind(this));
this._openedSubMenu = null;
},
this.actor.add_actor(this.box);
this.actor._delegate = this;
this.actor.clip_to_allocation = true;
- this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
+ this.actor.connect('key-press-event', this._onKeyPressEvent.bind(this));
this.actor.hide();
},
this.actor.add_accessible_state (Atk.StateType.EXPANDABLE);
this.menu = new PopupSubMenu(this.actor, this._triangle);
- this.menu.connect('open-state-changed', Lang.bind(this, this._subMenuOpenStateChanged));
+ this.menu.connect('open-state-changed', this._subMenuOpenStateChanged.bind(this));
},
_setParent(parent) {
let menudata = {
menu: menu,
- openStateChangeId: menu.connect('open-state-changed', Lang.bind(this, this._onMenuOpenState)),
- destroyId: menu.connect('destroy', Lang.bind(this, this._onMenuDestroy)),
+ openStateChangeId: menu.connect('open-state-changed', this._onMenuOpenState.bind(this)),
+ destroyId: menu.connect('destroy', this._onMenuDestroy.bind(this)),
enterId: 0,
focusInId: 0
};
if (this.activeMenu)
this.activeMenu.close(BoxPointer.PopupAnimation.FADE);
this._grabHelper.grab({ actor: menu.actor, focus: menu.sourceActor,
- onUngrab: Lang.bind(this, this._closeMenu, menu) });
+ onUngrab: isUser => {
+ this._closeMenu(isUser, menu);
+ } });
} else {
this._grabHelper.ungrab({ actor: menu.actor });
}
_init(trackerItem) {
this._trackerItem = trackerItem;
this.menuItem = new PopupMenu.PopupSeparatorMenuItem();
- this._trackerItem.connect('notify::label', Lang.bind(this, this._updateLabel));
+ this._trackerItem.connect('notify::label', this._updateLabel.bind(this));
this._updateLabel();
this.menuItem.connect('destroy', () => {
_init(trackerItem) {
this._trackerItem = trackerItem;
this.menuItem = new RequestSubMenu();
- this._trackerItem.connect('notify::label', Lang.bind(this, this._updateLabel));
+ this._trackerItem.connect('notify::label', this._updateLabel.bind(this));
this._updateLabel();
this._tracker = Shell.MenuTracker.new_for_item_submenu(this._trackerItem,
this._trackerItem.bind_property('visible', this.menuItem.actor, 'visible', GObject.BindingFlags.SYNC_CREATE);
- this._trackerItem.connect('notify::label', Lang.bind(this, this._updateLabel));
- this._trackerItem.connect('notify::sensitive', Lang.bind(this, this._updateSensitivity));
- this._trackerItem.connect('notify::role', Lang.bind(this, this._updateRole));
- this._trackerItem.connect('notify::toggled', Lang.bind(this, this._updateDecoration));
+ this._trackerItem.connect('notify::label', this._updateLabel.bind(this));
+ this._trackerItem.connect('notify::sensitive', this._updateSensitivity.bind(this));
+ this._trackerItem.connect('notify::role', this._updateRole.bind(this));
+ this._trackerItem.connect('notify::toggled', this._updateDecoration.bind(this));
this._updateLabel();
this._updateSensitivity();
getInitialResultSet(terms, callback, cancellable) {
this.proxy.GetInitialResultSetRemote(terms,
- Lang.bind(this, this._getResultsFinished, callback),
+ (results, error) => {
+ this._getResultsFinished(results, error, callback);
+ },
cancellable);
},
getSubsearchResultSet(previousResults, newTerms, callback, cancellable) {
this.proxy.GetSubsearchResultSetRemote(previousResults, newTerms,
- Lang.bind(this, this._getResultsFinished, callback),
+ (results, error) => {
+ this._getResultsFinished(results, error, callback);
+ },
cancellable);
},
resultMetas.push({ id: metas[i]['id'],
name: metas[i]['name'],
description: metas[i]['description'],
- createIcon: Lang.bind(this,
- this.createIcon, metas[i]),
+ createIcon: size => {
+ this.createIcon(size, metas[i]);
+ },
clipboardText: metas[i]['clipboardText'] });
}
callback(resultMetas);
getResultMetas(ids, callback, cancellable) {
this.proxy.GetResultMetasRemote(ids,
- Lang.bind(this, this._getResultMetasFinished, callback),
+ (results, error) => {
+ this._getResultMetasFinished(results, error, callback);
+ },
cancellable);
},
Main.createLookingGlass().open();
},
- 'r': Lang.bind(this, this._restart),
+ 'r': this._restart.bind(this),
// Developer brain backwards compatibility
- 'restart': Lang.bind(this, this._restart),
+ 'restart': this._restart.bind(this),
'debugexit': () => {
Meta.quit(Meta.ExitCode.ERROR);
this._errorBox.hide();
- this.setButtons([{ action: Lang.bind(this, this.close),
+ this.setButtons([{ action: this.close.bind(this),
label: _("Close"),
key: Clutter.Escape }]);
this.actor.add(this._date, { x_align: St.Align.MIDDLE });
this._wallClock = new GnomeDesktop.WallClock({ time_only: true });
- this._wallClock.connect('notify::clock', Lang.bind(this, this._updateClock));
+ this._wallClock.connect('notify::clock', this._updateClock.bind(this));
this._updateClock();
},
});
this._updateVisibility();
- this._sourceAddedId = Main.messageTray.connect('source-added', Lang.bind(this, this._sourceAdded));
+ this._sourceAddedId = Main.messageTray.connect('source-added', this._sourceAdded.bind(this));
},
destroy() {
this.x_fill = this.y_fill = true;
this._drawingArea = new St.DrawingArea();
- this._drawingArea.connect('repaint', Lang.bind(this, this._drawArrow));
+ this._drawingArea.connect('repaint', this._drawArrow.bind(this));
this.child = this._drawingArea;
this._shadowHelper = null;
visible: false,
});
this._lockScreenGroup.connect('key-press-event',
- Lang.bind(this, this._onLockScreenKeyPress));
+ this._onLockScreenKeyPress.bind(this));
this._lockScreenGroup.connect('scroll-event',
- Lang.bind(this, this._onLockScreenScroll));
+ this._onLockScreenScroll.bind(this));
Main.ctrlAltTabManager.addGroup(this._lockScreenGroup, _("Lock"), 'changes-prevent-symbolic');
this._lockScreenContents = new St.Widget({ layout_manager: new Clutter.BinLayout(),
this._bgManagers = [];
this._updateBackgrounds();
- Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._updateBackgrounds));
+ Main.layoutManager.connect('monitors-changed', this._updateBackgrounds.bind(this));
this._arrowAnimationId = 0;
this._arrowWatchId = 0;
this._lockScreenContents.add_actor(this._arrowContainer);
this._dragAction = new Clutter.GestureAction();
- this._dragAction.connect('gesture-begin', Lang.bind(this, this._onDragBegin));
- this._dragAction.connect('gesture-progress', Lang.bind(this, this._onDragMotion));
- this._dragAction.connect('gesture-end', Lang.bind(this, this._onDragEnd));
+ this._dragAction.connect('gesture-begin', this._onDragBegin.bind(this));
+ this._dragAction.connect('gesture-progress', this._onDragMotion.bind(this));
+ this._dragAction.connect('gesture-end', this._onDragEnd.bind(this));
this._lockScreenGroup.add_action(this._dragAction);
this._lockDialogGroup = new St.Widget({ x_expand: true,
this._loginManager = LoginManager.getLoginManager();
this._loginManager.connect('prepare-for-sleep',
- Lang.bind(this, this._prepareForSleep));
+ this._prepareForSleep.bind(this));
this._loginSession = null;
this._loginManager.getCurrentSessionProxy(sessionProxy => {
() => { this.lock(false); });
this._loginSession.connectSignal('Unlock',
() => { this.deactivate(false); });
- this._loginSession.connect('g-properties-changed', Lang.bind(this, this._syncInhibitor));
+ this._loginSession.connect('g-properties-changed', this._syncInhibitor.bind(this));
this._syncInhibitor();
});
this._settings = new Gio.Settings({ schema_id: SCREENSAVER_SCHEMA });
- this._settings.connect('changed::' + LOCK_ENABLED_KEY, Lang.bind(this, this._syncInhibitor));
+ this._settings.connect('changed::' + LOCK_ENABLED_KEY, this._syncInhibitor.bind(this));
this._lockSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
- this._lockSettings.connect('changed::' + DISABLE_LOCK_KEY, Lang.bind(this, this._syncInhibitor));
+ this._lockSettings.connect('changed::' + DISABLE_LOCK_KEY, this._syncInhibitor.bind(this));
this._isModal = false;
this._hasLockScreen = false;
this._longLightbox = new Lightbox.Lightbox(Main.uiGroup,
{ inhibitEvents: true,
fadeFactor: 1 });
- this._longLightbox.connect('shown', Lang.bind(this, this._onLongLightboxShown));
+ this._longLightbox.connect('shown', this._onLongLightboxShown.bind(this));
this._shortLightbox = new Lightbox.Lightbox(Main.uiGroup,
{ inhibitEvents: true,
fadeFactor: 1 });
- this._shortLightbox.connect('shown', Lang.bind(this, this._onShortLightboxShown));
+ this._shortLightbox.connect('shown', this._onShortLightboxShown.bind(this));
this.idleMonitor = Meta.IdleMonitor.get_core();
this._cursorTracker = Meta.CursorTracker.get_for_screen(global.screen);
lightbox.show(time);
if (this._becameActiveId == 0)
- this._becameActiveId = this.idleMonitor.add_user_active_watch(Lang.bind(this, this._onUserBecameActive));
+ this._becameActiveId = this.idleMonitor.add_user_active_watch(this._onUserBecameActive.bind(this));
},
_onUserBecameActive() {
{ y: -h,
time: time,
transition: 'easeInQuad',
- onComplete: Lang.bind(this, this._hideLockScreenComplete),
+ onComplete: this._hideLockScreenComplete.bind(this),
});
} else {
this._hideLockScreenComplete();
return false;
}
- this._dialog.connect('failed', Lang.bind(this, this._onUnlockFailed));
+ this._dialog.connect('failed', this._onUnlockFailed.bind(this));
}
this._dialog.allowCancel = allowCancel;
this._arrowActiveWatchId = 0;
if (!this._arrowAnimationId) {
- this._arrowAnimationId = Mainloop.timeout_add(6000, Lang.bind(this, this._animateArrows));
+ this._arrowAnimationId = Mainloop.timeout_add(6000, this._animateArrows.bind(this));
GLib.Source.set_name_by_id(this._arrowAnimationId, '[gnome-shell] this._animateArrows');
this._animateArrows();
}
if (!this._arrowWatchId)
this._arrowWatchId = this.idleMonitor.add_idle_watch(ARROW_IDLE_TIME,
- Lang.bind(this, this._pauseArrowAnimation));
+ this._pauseArrowAnimation.bind(this));
},
_pauseArrowAnimation() {
}
if (!this._arrowActiveWatchId)
- this._arrowActiveWatchId = this.idleMonitor.add_user_active_watch(Lang.bind(this, this._startArrowAnimation));
+ this._arrowActiveWatchId = this.idleMonitor.add_user_active_watch(this._startArrowAnimation.bind(this));
},
_stopArrowAnimation() {
this._lockScreenContents.add_actor(this._lockScreenContentsBox);
this._notificationsBox = new NotificationsBox();
- this._wakeUpScreenId = this._notificationsBox.connect('wake-up-screen', Lang.bind(this, this._wakeUpScreen));
+ this._wakeUpScreenId = this._notificationsBox.connect('wake-up-screen', this._wakeUpScreen.bind(this));
this._lockScreenContentsBox.add(this._notificationsBox.actor, { x_fill: true,
y_fill: true,
expand: true });
scale_y: 0,
time: animate ? Overview.ANIMATION_TIME : 0,
transition: 'easeOutQuad',
- onComplete: Lang.bind(this, this._completeDeactivate),
+ onComplete: this._completeDeactivate.bind(this),
onCompleteScope: this
});
},
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
},
get isRecording() {
screen: global.screen });
recorder._watchNameId =
Gio.bus_watch_name(Gio.BusType.SESSION, sender, 0, null,
- Lang.bind(this, this._onNameVanished));
+ this._onNameVanished.bind(this));
this._recorders.set(sender, recorder);
this.emit('updated');
}
let shooter = new Shell.Screenshot();
shooter._watchNameId =
Gio.bus_watch_name(Gio.BusType.SESSION, sender, 0, null,
- Lang.bind(this, this._onNameVanished));
+ this._onNameVanished.bind(this));
this._screenShooter.set(sender, shooter);
if (!screenshot)
return;
screenshot.screenshot_area (x, y, width, height, filename,
- Lang.bind(this, this._onScreenshotComplete,
- flash, invocation));
+ (obj, result, area, filenameUsed) => {
+ this._onScreenshotComplete(obj, result, area, filenameUsed,
+ flash, invocation);
+ });
},
ScreenshotWindowAsync(params, invocation) {
if (!screenshot)
return;
screenshot.screenshot_window (include_frame, include_cursor, filename,
- Lang.bind(this, this._onScreenshotComplete,
- flash, invocation));
+ (obj, result, area, filenameUsed) => {
+ this._onScreenshotComplete(obj, result, area, filenameUsed,
+ flash, invocation);
+ });
},
ScreenshotAsync(params, invocation) {
if (!screenshot)
return;
screenshot.screenshot(include_cursor, filename,
- Lang.bind(this, this._onScreenshotComplete,
- flash, invocation));
+ (obj, result, area, filenameUsed) => {
+ this._onScreenshotComplete(obj, result, area, filenameUsed,
+ flash, invocation);
+ });
},
SelectAreaAsync(params, invocation) {
this._grabHelper = new GrabHelper.GrabHelper(this._group);
this._group.connect('button-press-event',
- Lang.bind(this, this._onButtonPress));
+ this._onButtonPress.bind(this));
this._group.connect('button-release-event',
- Lang.bind(this, this._onButtonRelease));
+ this._onButtonRelease.bind(this));
this._group.connect('motion-event',
- Lang.bind(this, this._onMotionEvent));
+ this._onMotionEvent.bind(this));
let constraint = new Clutter.BindConstraint({ source: global.stage,
coordinate: Clutter.BindCoordinate.ALL });
show() {
if (!this._grabHelper.grab({ actor: this._group,
- onUngrab: Lang.bind(this, this._onUngrab) }))
+ onUngrab: this._onUngrab.bind(this) }))
return;
global.screen.set_cursor(Meta.Cursor.CROSSHAIR);
y_fill: true });
this.actor._delegate = this;
- this.actor.connect('clicked', Lang.bind(this, this.activate));
+ this.actor.connect('clicked', this.activate.bind(this));
},
activate() {
this._termsChangedId =
this._resultsView.connect('terms-changed',
- Lang.bind(this, this._highlightTerms));
+ this._highlightTerms.bind(this));
this._highlightTerms();
}
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
},
_highlightTerms() {
metasNeeded.forEach((resultId, i) => {
let meta = metas[i];
let display = this._createResultDisplay(meta);
- display.connect('activate', Lang.bind(this, this._activateResult));
- display.actor.connect('key-focus-in', Lang.bind(this, this._keyFocusIn));
+ display.connect('activate', this._activateResult.bind(this));
+ display.actor.connect('key-focus-in', this._keyFocusIn.bind(this));
this._resultDisplays[resultId] = display;
});
callback(true);
this._container = new St.BoxLayout({ style_class: 'search-section-content' });
this.providerInfo = new ProviderInfo(provider);
- this.providerInfo.connect('key-focus-in', Lang.bind(this, this._keyFocusIn));
+ this.providerInfo.connect('key-focus-in', this._keyFocusIn.bind(this));
this.providerInfo.connect('clicked', () => {
this.providerInfo.animateLaunch();
provider.launchSearch(this._terms);
this._scrollView.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
this._scrollView.add_actor(scrollChild);
let action = new Clutter.PanAction({ interpolate: true });
- action.connect('pan', Lang.bind(this, this._onPan));
+ action.connect('pan', this._onPan.bind(this));
this._scrollView.add_action(action);
this.actor.add(this._scrollView, { x_fill: true,
this._highlightRegex = null;
this._searchSettings = new Gio.Settings({ schema_id: SEARCH_PROVIDERS_SCHEMA });
- this._searchSettings.connect('changed::disabled', Lang.bind(this, this._reloadRemoteProviders));
- this._searchSettings.connect('changed::enabled', Lang.bind(this, this._reloadRemoteProviders));
- this._searchSettings.connect('changed::disable-external', Lang.bind(this, this._reloadRemoteProviders));
- this._searchSettings.connect('changed::sort-order', Lang.bind(this, this._reloadRemoteProviders));
+ this._searchSettings.connect('changed::disabled', this._reloadRemoteProviders.bind(this));
+ this._searchSettings.connect('changed::enabled', this._reloadRemoteProviders.bind(this));
+ this._searchSettings.connect('changed::disable-external', this._reloadRemoteProviders.bind(this));
+ this._searchSettings.connect('changed::sort-order', this._reloadRemoteProviders.bind(this));
this._searchTimeoutId = 0;
this._cancellable = new Gio.Cancellable();
});
RemoteSearch.loadRemoteSearchProviders(this._searchSettings, providers => {
- providers.forEach(Lang.bind(this, this._registerProvider));
+ providers.forEach(this._registerProvider.bind(this));
});
},
let previousProviderResults = previousResults[provider.id];
if (this._isSubSearch && previousProviderResults)
- provider.getSubsearchResultSet(previousProviderResults, this._terms, Lang.bind(this, this._gotResults, provider), this._cancellable);
+ provider.getSubsearchResultSet(previousProviderResults,
+ this._terms,
+ results => {
+ this._gotResults(results, provider);
+ },
+ this._cancellable);
else
- provider.getInitialResultSet(this._terms, Lang.bind(this, this._gotResults, provider), this._cancellable);
+ provider.getInitialResultSet(this._terms,
+ results => {
+ this._gotResults(results, provider);
+ },
+ this._cancellable);
});
this._updateSearchProgress();
this._updateSearchProgress();
if (this._searchTimeoutId == 0)
- this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, Lang.bind(this, this._onSearchTimeout));
+ this._searchTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 150, this._onSearchTimeout.bind(this));
let escapedTerms = this._terms.map(term => Shell.util_regex_escape(term));
this._highlightRegex = new RegExp(`(${escapedTerms.join('|')})`, 'gi');
else
providerDisplay = new GridSearchResults(provider, this);
- providerDisplay.connect('key-focus-in', Lang.bind(this, this._keyFocusIn));
+ providerDisplay.connect('key-focus-in', this._keyFocusIn.bind(this));
providerDisplay.actor.hide();
this._content.add(providerDisplay.actor);
provider.display = providerDisplay;
this._cachedOverviewVisible = false;
Main.overview.connect('showing',
- Lang.bind(this, this._checkOverviewVisibleChanged));
+ this._checkOverviewVisibleChanged.bind(this));
Main.overview.connect('hidden',
- Lang.bind(this, this._checkOverviewVisibleChanged));
+ this._checkOverviewVisibleChanged.bind(this));
},
/**
if (!this._grabbers.has(sender)) {
let id = Gio.bus_watch_name(Gio.BusType.SESSION, sender, 0, null,
- Lang.bind(this, this._onGrabberBusNameVanished));
+ this._onGrabberBusNameVanished.bind(this));
this._grabbers.set(sender, id);
}
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(GnomeShellExtensionsIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/Shell');
ExtensionSystem.connect('extension-state-changed',
- Lang.bind(this, this._extensionStateChanged));
+ this._extensionStateChanged.bind(this));
},
// Populate menu
let item;
item = new PopupMenu.PopupMenuItem(_("Copy"));
- item.connect('activate', Lang.bind(this, this._onCopyActivated));
+ item.connect('activate', this._onCopyActivated.bind(this));
this.addMenuItem(item);
this._copyItem = item;
item = new PopupMenu.PopupMenuItem(_("Paste"));
- item.connect('activate', Lang.bind(this, this._onPasteActivated));
+ item.connect('activate', this._onPasteActivated.bind(this));
this.addMenuItem(item);
this._pasteItem = item;
_makePasswordItem() {
let item = new PopupMenu.PopupMenuItem('');
- item.connect('activate', Lang.bind(this,
- this._onPasswordActivated));
+ item.connect('activate', this._onPasswordActivated.bind(this));
this.addMenuItem(item);
this._passwordItem = item;
},
// Add an event handler to both the entry and its clutter_text; the former
// so padding is included in the clickable area, the latter because the
// event processing of ClutterText prevents event-bubbling.
- entry.clutter_text.connect('button-press-event', Lang.bind(null, _onButtonPressEvent, entry));
- entry.connect('button-press-event', Lang.bind(null, _onButtonPressEvent, entry));
+ entry.clutter_text.connect('button-press-event', (actor, event) => {
+ _onButtonPressEvent(actor, event, entry);
+ });
+ entry.connect('button-press-event', (actor, event) => {
+ _onButtonPressEvent(actor, event, entry);
+ });
- entry.connect('popup-menu', Lang.bind(null, _onPopup, entry));
+ entry.connect('popup-menu', actor => { _onPopup(actor, entry); });
entry.connect('destroy', () => {
entry.menu.destroy();
for (let idx = 0; idx < choices.length; idx++) {
let button = idx;
buttons.unshift({ label: choices[idx],
- action: Lang.bind(dialog, function() {
- dialog.emit('response', button);
- })});
+ action: () => { dialog.emit('response', button); }
+ });
}
dialog.setButtons(buttons);
child: this._nameLabel });
layout.add(labelBin);
- this.actor.connect('clicked', Lang.bind(this, this._onClicked));
+ this.actor.connect('clicked', this._onClicked.bind(this));
},
_onClicked() {
this.mountOp = new Shell.MountOperation();
this.mountOp.connect('ask-question',
- Lang.bind(this, this._onAskQuestion));
+ this._onAskQuestion.bind(this));
this.mountOp.connect('ask-password',
- Lang.bind(this, this._onAskPassword));
+ this._onAskPassword.bind(this));
this.mountOp.connect('show-processes-2',
- Lang.bind(this, this._onShowProcesses2));
+ this._onShowProcesses2.bind(this));
this.mountOp.connect('aborted',
- Lang.bind(this, this.close));
+ this.close.bind(this));
this.mountOp.connect('show-unmount-progress',
- Lang.bind(this, this._onShowUnmountProgress));
+ this._onShowUnmountProgress.bind(this));
this._gicon = source.get_icon();
},
text: "",
can_focus: true});
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
- this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivate));
+ this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
this._passwordBox.add(this._passwordEntry, {expand: true });
this.setInitialKeyFocus(this._passwordEntry);
}
let buttons = [{ label: _("Cancel"),
- action: Lang.bind(this, this._onCancelButton),
+ action: this._onCancelButton.bind(this),
key: Clutter.Escape
},
{ label: _("Unlock"),
- action: Lang.bind(this, this._onUnlockButton),
+ action: this._onUnlockButton.bind(this),
default: true
}];
can_focus: true,
reactive: true,
accessible_role: Atk.Role.SLIDER });
- this.actor.connect('repaint', Lang.bind(this, this._sliderRepaint));
- this.actor.connect('button-press-event', Lang.bind(this, this._startDragging));
- this.actor.connect('touch-event', Lang.bind(this, this._touchDragging));
- this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
- this.actor.connect('key-press-event', Lang.bind(this, this.onKeyPressEvent));
+ this.actor.connect('repaint', this._sliderRepaint.bind(this));
+ this.actor.connect('button-press-event', this._startDragging.bind(this));
+ this.actor.connect('touch-event', this._touchDragging.bind(this));
+ this.actor.connect('scroll-event', this._onScrollEvent.bind(this));
+ this.actor.connect('key-press-event', this.onKeyPressEvent.bind(this));
this.actor.connect('allocation-changed', (actor, box) => {
this._sliderWidth = box.get_width();
});
this._customAccessible = St.GenericAccessible.new_for_actor(this.actor);
this.actor.set_accessible(this._customAccessible);
- this._customAccessible.connect('get-current-value', Lang.bind(this, this._getCurrentValue));
- this._customAccessible.connect('get-minimum-value', Lang.bind(this, this._getMinimumValue));
- this._customAccessible.connect('get-maximum-value', Lang.bind(this, this._getMaximumValue));
- this._customAccessible.connect('get-minimum-increment', Lang.bind(this, this._getMinimumIncrement));
- this._customAccessible.connect('set-current-value', Lang.bind(this, this._setCurrentValue));
+ this._customAccessible.connect('get-current-value', this._getCurrentValue.bind(this));
+ this._customAccessible.connect('get-minimum-value', this._getMinimumValue.bind(this));
+ this._customAccessible.connect('get-maximum-value', this._getMaximumValue.bind(this));
+ this._customAccessible.connect('get-minimum-increment', this._getMinimumIncrement.bind(this));
+ this._customAccessible.connect('set-current-value', this._setCurrentValue.bind(this));
- this.connect('value-changed', Lang.bind(this, this._valueChanged));
+ this.connect('value-changed', this._valueChanged.bind(this));
},
setValue(value) {
this._grabbedSequence = sequence;
if (sequence == null) {
- this._releaseId = this.actor.connect('button-release-event', Lang.bind(this, this._endDragging));
- this._motionId = this.actor.connect('motion-event', Lang.bind(this, this._motionEvent));
+ this._releaseId = this.actor.connect('button-release-event', this._endDragging.bind(this));
+ this._motionId = this.actor.connect('motion-event', this._motionEvent.bind(this));
}
// We need to emit 'drag-begin' before moving the handle to make
this.actor.add_child(this._hbox);
this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA });
- this._a11ySettings.connect('changed::' + KEY_ALWAYS_SHOW, Lang.bind(this, this._queueSyncMenuVisibility));
+ this._a11ySettings.connect('changed::' + KEY_ALWAYS_SHOW, this._queueSyncMenuVisibility.bind(this));
let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast);
if (this._syncMenuVisibilityIdle)
return;
- this._syncMenuVisibilityIdle = Mainloop.idle_add(Lang.bind(this, this._syncMenuVisibility));
+ this._syncMenuVisibilityIdle = Mainloop.idle_add(this._syncMenuVisibility.bind(this));
GLib.Source.set_name_by_id(this._syncMenuVisibilityIdle, '[gnome-shell] this._syncMenuVisibility');
},
this._sync();
});
- this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
+ this._proxy.connect('g-properties-changed', this._sync.bind(this));
this._item = new PopupMenu.PopupSubMenuMenuItem(_("Bluetooth"), true);
this._item.icon.icon_name = 'bluetooth-active-symbolic';
this._client = new GnomeBluetooth.Client();
this._model = this._client.get_model();
- this._model.connect('row-changed', Lang.bind(this, this._sync));
- this._model.connect('row-deleted', Lang.bind(this, this._sync));
- this._model.connect('row-inserted', Lang.bind(this, this._sync));
- Main.sessionMode.connect('updated', Lang.bind(this, this._sync));
+ this._model.connect('row-changed', this._sync.bind(this));
+ this._model.connect('row-deleted', this._sync.bind(this));
+ this._model.connect('row-inserted', this._sync.bind(this));
+ Main.sessionMode.connect('updated', this._sync.bind(this));
this._sync();
},
return;
}
- this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
+ this._proxy.connect('g-properties-changed', this._sync.bind(this));
this._sync();
});
this.menu.addMenuItem(this._item);
this._slider = new Slider.Slider(0);
- this._slider.connect('value-changed', Lang.bind(this, this._sliderChanged));
+ this._slider.connect('value-changed', this._sliderChanged.bind(this));
this._slider.actor.accessible_name = _("Brightness");
let icon = new St.Icon({ icon_name: 'display-brightness-symbolic',
this._BUS_PATH,
null,
Gio.DBusSignalFlags.NONE,
- Lang.bind(this, this._reload));
+ this._reload.bind(this));
},
_reload() {
_init() {
this._settings = new Gio.Settings({ schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA });
- this._settings.connect('changed::' + this._KEY_INPUT_SOURCES, Lang.bind(this, this._emitInputSourcesChanged));
- this._settings.connect('changed::' + this._KEY_KEYBOARD_OPTIONS, Lang.bind(this, this._emitKeyboardOptionsChanged));
- this._settings.connect('changed::' + this._KEY_PER_WINDOW, Lang.bind(this, this._emitPerWindowChanged));
+ this._settings.connect('changed::' + this._KEY_INPUT_SOURCES, this._emitInputSourcesChanged.bind(this));
+ this._settings.connect('changed::' + this._KEY_KEYBOARD_OPTIONS, this._emitKeyboardOptionsChanged.bind(this));
+ this._settings.connect('changed::' + this._KEY_PER_WINDOW, this._emitPerWindowChanged.bind(this));
},
_getSourcesList(key) {
new Gio.Settings({ schema_id: "org.gnome.desktop.wm.keybindings" }),
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.ALL,
- Lang.bind(this, this._switchInputSource));
+ this._switchInputSource.bind(this));
this._keybindingActionBackward =
Main.wm.addKeybinding('switch-input-source-backward',
new Gio.Settings({ schema_id: "org.gnome.desktop.wm.keybindings" }),
Meta.KeyBindingFlags.IS_REVERSED,
Shell.ActionMode.ALL,
- Lang.bind(this, this._switchInputSource));
+ this._switchInputSource.bind(this));
if (Main.sessionMode.isGreeter)
this._settings = new InputSourceSystemSettings();
else
this._settings = new InputSourceSessionSettings();
- this._settings.connect('input-sources-changed', Lang.bind(this, this._inputSourcesChanged));
- this._settings.connect('keyboard-options-changed', Lang.bind(this, this._keyboardOptionsChanged));
+ this._settings.connect('input-sources-changed', this._inputSourcesChanged.bind(this));
+ this._settings.connect('keyboard-options-changed', this._keyboardOptionsChanged.bind(this));
this._xkbInfo = KeyboardManager.getXkbInfo();
this._keyboardManager = KeyboardManager.getKeyboardManager();
this._ibusReady = false;
this._ibusManager = IBusManager.getIBusManager();
- this._ibusManager.connect('ready', Lang.bind(this, this._ibusReadyCallback));
- this._ibusManager.connect('properties-registered', Lang.bind(this, this._ibusPropertiesRegistered));
- this._ibusManager.connect('property-updated', Lang.bind(this, this._ibusPropertyUpdated));
- this._ibusManager.connect('set-content-type', Lang.bind(this, this._ibusSetContentType));
+ this._ibusManager.connect('ready', this._ibusReadyCallback.bind(this));
+ this._ibusManager.connect('properties-registered', this._ibusPropertiesRegistered.bind(this));
+ this._ibusManager.connect('property-updated', this._ibusPropertyUpdated.bind(this));
+ this._ibusManager.connect('set-content-type', this._ibusSetContentType.bind(this));
- global.display.connect('modifiers-accelerator-activated', Lang.bind(this, this._modifiersSwitcher));
+ global.display.connect('modifiers-accelerator-activated', this._modifiersSwitcher.bind(this));
this._sourcesPerWindow = false;
this._focusWindowNotifyId = 0;
this._overviewShowingId = 0;
this._overviewHiddenId = 0;
- this._settings.connect('per-window-changed', Lang.bind(this, this._sourcesPerWindowChanged));
+ this._settings.connect('per-window-changed', this._sourcesPerWindowChanged.bind(this));
this._sourcesPerWindowChanged();
this._disableIBus = false;
},
infosList[i].displayName,
infosList[i].shortName,
i);
- is.connect('activate', Lang.bind(this, this.activateInputSource));
+ is.connect('activate', this.activateInputSource.bind(this));
if (!(is.shortName in inputSourcesByShortName))
inputSourcesByShortName[is.shortName] = [];
if (this._sourcesPerWindow && this._focusWindowNotifyId == 0) {
this._focusWindowNotifyId = global.display.connect('notify::focus-window',
- Lang.bind(this, this._setPerWindowInputSource));
+ this._setPerWindowInputSource.bind(this));
this._overviewShowingId = Main.overview.connect('showing',
- Lang.bind(this, this._setPerWindowInputSource));
+ this._setPerWindowInputSource.bind(this));
this._overviewHiddenId = Main.overview.connect('hidden',
- Lang.bind(this, this._setPerWindowInputSource));
+ this._setPerWindowInputSource.bind(this));
} else if (!this._sourcesPerWindow && this._focusWindowNotifyId != 0) {
global.display.disconnect(this._focusWindowNotifyId);
this._focusWindowNotifyId = 0;
this._indicatorLabels = {};
this._container = new Shell.GenericContainer();
- this._container.connect('get-preferred-width', Lang.bind(this, this._containerGetPreferredWidth));
- this._container.connect('get-preferred-height', Lang.bind(this, this._containerGetPreferredHeight));
- this._container.connect('allocate', Lang.bind(this, this._containerAllocate));
+ this._container.connect('get-preferred-width', this._containerGetPreferredWidth.bind(this));
+ this._container.connect('get-preferred-height', this._containerGetPreferredHeight.bind(this));
+ this._container.connect('allocate', this._containerAllocate.bind(this));
this._hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' });
this._hbox.add_child(this._container);
this._propSection.actor.hide();
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
- this._showLayoutItem = this.menu.addAction(_("Show Keyboard Layout"), Lang.bind(this, this._showLayout));
+ this._showLayoutItem = this.menu.addAction(_("Show Keyboard Layout"), this._showLayout.bind(this));
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
this._inputSourceManager = getInputSourceManager();
- this._inputSourceManager.connect('sources-changed', Lang.bind(this, this._sourcesChanged));
- this._inputSourceManager.connect('current-source-changed', Lang.bind(this, this._currentSourceChanged));
+ this._inputSourceManager.connect('sources-changed', this._sourcesChanged.bind(this));
+ this._inputSourceManager.connect('current-source-changed', this._currentSourceChanged.bind(this));
this._inputSourceManager.reload();
},
this._settings = new Gio.Settings({ schema_id: LOCATION_SCHEMA });
this._settings.connect('changed::' + ENABLED,
- Lang.bind(this, this._onMaxAccuracyLevelChanged));
+ this._onMaxAccuracyLevelChanged.bind(this));
this._settings.connect('changed::' + MAX_ACCURACY_LEVEL,
- Lang.bind(this, this._onMaxAccuracyLevelChanged));
+ this._onMaxAccuracyLevelChanged.bind(this));
this._indicator = this._addIndicator();
this._indicator.icon_name = 'find-location-symbolic';
this._agent.export(Gio.DBus.system, '/org/freedesktop/GeoClue2/Agent');
this._item.label.text = _("Location Enabled");
- this._onOffAction = this._item.menu.addAction(_("Disable"), Lang.bind(this, this._onOnOffAction));
+ this._onOffAction = this._item.menu.addAction(_("Disable"), this._onOnOffAction.bind(this));
this._item.menu.addSettingsAction(_("Privacy Settings"), 'gnome-privacy-panel.desktop');
this.menu.addMenuItem(this._item);
this._watchId = Gio.bus_watch_name(Gio.BusType.SYSTEM,
'org.freedesktop.GeoClue2',
0,
- Lang.bind(this, this._connectToGeoclue),
- Lang.bind(this, this._onGeoclueVanished));
- Main.sessionMode.connect('updated', Lang.bind(this, this._onSessionUpdated));
+ this._connectToGeoclue.bind(this),
+ this._onGeoclueVanished.bind(this));
+ Main.sessionMode.connect('updated', this._onSessionUpdated.bind(this));
this._onSessionUpdated();
this._onMaxAccuracyLevelChanged();
this._connectToGeoclue();
new GeoclueManager(Gio.DBus.system,
'org.freedesktop.GeoClue2',
'/org/freedesktop/GeoClue2/Manager',
- Lang.bind(this, this._onManagerProxyReady));
+ this._onManagerProxyReady.bind(this));
return true;
},
this._managerProxy = proxy;
this._propertiesChangedId = this._managerProxy.connect('g-properties-changed',
- Lang.bind(this, this._onGeocluePropsChanged));
+ this._onGeocluePropsChanged.bind(this));
this._syncIndicator();
- this._managerProxy.AddAgentRemote('gnome-shell', Lang.bind(this, this._onAgentRegistered));
+ this._managerProxy.AddAgentRemote('gnome-shell', this._onAgentRegistered.bind(this));
},
_onAgentRegistered(result, error) {
_connectToPermissionStore() {
this._permStoreProxy = null;
- new PermissionStore.PermissionStore(Lang.bind(this, this._onPermStoreProxyReady), null);
+ new PermissionStore.PermissionStore(this._onPermStoreProxyReady.bind(this));
},
_onPermStoreProxyReady(proxy, error) {
this._permStoreProxy.LookupRemote(APP_PERMISSIONS_TABLE,
APP_PERMISSIONS_ID,
- Lang.bind(this,
- this._onPermLookupDone));
+ this._onPermLookupDone.bind(this));
},
_onPermLookupDone(result, error) {
this.contentLayout.add_actor(content);
let button = this.addButton({ label: _("Deny Access"),
- action: Lang.bind(this, this._onDenyClicked),
+ action: this._onDenyClicked.bind(this),
key: Clutter.KEY_Escape });
this.addButton({ label: _("Grant Access"),
- action: Lang.bind(this, this._onGrantClicked) });
+ action: this._onGrantClicked.bind(this) });
this.setInitialKeyFocus(button);
},
_buildUI() {
this.labelItem = new PopupMenu.PopupMenuItem('');
- this.labelItem.connect('activate', Lang.bind(this, this._toggle));
+ this.labelItem.connect('activate', this._toggle.bind(this));
this.radioItem = new PopupMenu.PopupMenuItem(this._connection.get_id(), false);
- this.radioItem.connect('activate', Lang.bind(this, this._activate));
+ this.radioItem.connect('activate', this._activate.bind(this));
},
destroy() {
if (this._activeConnection)
this._activeConnectionChangedId = this._activeConnection.connect('notify::state',
- Lang.bind(this, this._connectionStateChanged));
+ this._connectionStateChanged.bind(this));
this._sync();
},
this.item.menu.addMenuItem(this._labelSection);
this.item.menu.addMenuItem(this._radioSection);
- this._notifyConnectivityId = this._client.connect('notify::connectivity', Lang.bind(this, this._iconChanged));
+ this._notifyConnectivityId = this._client.connect('notify::connectivity', this._iconChanged.bind(this));
},
destroy() {
let pos = this._connections.indexOf(connection);
this._connections.splice(pos, 1);
- pos = Util.insertSorted(this._connections, connection, Lang.bind(this, this._connectionSortFunction));
+ pos = Util.insertSorted(this._connections, connection, this._connectionSortFunction.bind(this));
this._labelSection.moveMenuItem(item.labelItem, pos);
this._radioSection.moveMenuItem(item.radioItem, pos);
item.connect('activation-failed', (item, reason) => {
this.emit('activation-failed', reason);
});
- item.connect('name-changed', Lang.bind(this, this._sync));
+ item.connect('name-changed', this._sync.bind(this));
- let pos = Util.insertSorted(this._connections, connection, Lang.bind(this, this._connectionSortFunction));
+ let pos = Util.insertSorted(this._connections, connection, this._connectionSortFunction.bind(this));
this._labelSection.addMenuItem(item.labelItem, pos);
this._radioSection.addMenuItem(item.radioItem, pos);
this._connectionItems.set(connection.get_uuid(), item);
this._device = device;
this._description = '';
- this._autoConnectItem = this.item.menu.addAction(_("Connect"), Lang.bind(this, this._autoConnect));
- this._deactivateItem = this._radioSection.addAction(_("Turn Off"), Lang.bind(this, this.deactivateConnection));
+ this._autoConnectItem = this.item.menu.addAction(_("Connect"), this._autoConnect.bind(this));
+ this._deactivateItem = this._radioSection.addAction(_("Turn Off"), this.deactivateConnection.bind(this));
- this._stateChangedId = this._device.connect('state-changed', Lang.bind(this, this._deviceStateChanged));
- this._activeConnectionChangedId = this._device.connect('notify::active-connection', Lang.bind(this, this._activeConnectionChanged));
+ this._stateChangedId = this._device.connect('state-changed', this._deviceStateChanged.bind(this));
+ this._activeConnectionChangedId = this._device.connect('notify::active-connection', this._activeConnectionChanged.bind(this));
},
_canReachInternet() {
this._mobileDevice = new ModemManager.ModemGsm(device.udi);
if (this._mobileDevice) {
- this._operatorNameId = this._mobileDevice.connect('notify::operator-name', Lang.bind(this, this._sync));
+ this._operatorNameId = this._mobileDevice.connect('notify::operator-name', this._sync.bind(this));
this._signalQualityId = this._mobileDevice.connect('notify::signal-quality', () => {
this._iconChanged();
});
this._device = device;
this._wirelessEnabledChangedId = this._client.connect('notify::wireless-enabled',
- Lang.bind(this, this._syncView));
+ this._syncView.bind(this));
this._rfkill = Rfkill.getRfkillManager();
this._airplaneModeChangedId = this._rfkill.connect('airplane-mode-changed',
- Lang.bind(this, this._syncView));
+ this._syncView.bind(this));
this._networks = [];
this._buildLayout();
connection => device.connection_valid(connection)
);
- this._apAddedId = device.connect('access-point-added', Lang.bind(this, this._accessPointAdded));
- this._apRemovedId = device.connect('access-point-removed', Lang.bind(this, this._accessPointRemoved));
- this._activeApChangedId = device.connect('notify::active-access-point', Lang.bind(this, this._activeApChanged));
+ this._apAddedId = device.connect('access-point-added', this._accessPointAdded.bind(this));
+ this._apRemovedId = device.connect('access-point-removed', this._accessPointRemoved.bind(this));
+ this._activeApChangedId = device.connect('notify::active-access-point', this._activeApChanged.bind(this));
// accessPointAdded will also create dialog items
let accessPoints = device.get_access_points() || [ ];
this._updateSensitivity();
this._syncView();
- this._scanTimeoutId = Mainloop.timeout_add_seconds(15, Lang.bind(this, this._onScanTimeout));
+ this._scanTimeoutId = Mainloop.timeout_add_seconds(15, this._onScanTimeout.bind(this));
GLib.Source.set_name_by_id(this._scanTimeoutId, '[gnome-shell] this._onScanTimeout');
this._onScanTimeout();
this.contentLayout.add(this._stack, { expand: true });
- this._disconnectButton = this.addButton({ action: Lang.bind(this, this.close),
+ this._disconnectButton = this.addButton({ action: this.close.bind(this),
label: _("Cancel"),
key: Clutter.Escape });
- this._connectButton = this.addButton({ action: Lang.bind(this, this._connect),
+ this._connectButton = this.addButton({ action: this._connect.bind(this),
label: _("Connect"),
key: Clutter.Return });
},
if (accessPoint.get_ssid() == null) {
// This access point is not visible yet
// Wait for it to get a ssid
- accessPoint._notifySsidId = accessPoint.connect('notify::ssid', Lang.bind(this, this._notifySsidCb));
+ accessPoint._notifySsidId = accessPoint.connect('notify::ssid', this._notifySsidCb.bind(this));
return;
}
this._description = '';
this.item = new PopupMenu.PopupSubMenuMenuItem('', true);
- this.item.menu.addAction(_("Select Network"), Lang.bind(this, this._showDialog));
+ this.item.menu.addAction(_("Select Network"), this._showDialog.bind(this));
this._toggleItem = new PopupMenu.PopupMenuItem('');
- this._toggleItem.connect('activate', Lang.bind(this, this._toggleWifi));
+ this._toggleItem.connect('activate', this._toggleWifi.bind(this));
this.item.menu.addMenuItem(this._toggleItem);
this.item.menu.addSettingsAction(_("Wi-Fi Settings"), 'gnome-wifi-panel.desktop');
- this._wirelessEnabledChangedId = this._client.connect('notify::wireless-enabled', Lang.bind(this, this._sync));
- this._wirelessHwEnabledChangedId = this._client.connect('notify::wireless-hardware-enabled', Lang.bind(this, this._sync));
- this._activeApChangedId = this._device.connect('notify::active-access-point', Lang.bind(this, this._activeApChanged));
- this._stateChangedId = this._device.connect('state-changed', Lang.bind(this, this._deviceStateChanged));
- this._notifyConnectivityId = this._client.connect('notify::connectivity', Lang.bind(this, this._iconChanged));
+ this._wirelessEnabledChangedId = this._client.connect('notify::wireless-enabled', this._sync.bind(this));
+ this._wirelessHwEnabledChangedId = this._client.connect('notify::wireless-hardware-enabled', this._sync.bind(this));
+ this._activeApChangedId = this._device.connect('notify::active-access-point', this._activeApChanged.bind(this));
+ this._stateChangedId = this._device.connect('state-changed', this._deviceStateChanged.bind(this));
+ this._notifyConnectivityId = this._client.connect('notify::connectivity', this._iconChanged.bind(this));
this._sync();
},
_showDialog() {
this._dialog = new NMWirelessDialog(this._client, this._device);
- this._dialog.connect('closed', Lang.bind(this, this._dialogClosed));
+ this._dialog.connect('closed', this._dialogClosed.bind(this));
this._dialog.open();
},
if (this._activeAccessPoint) {
this._strengthChangedId = this._activeAccessPoint.connect('notify::strength',
- Lang.bind(this, this._strengthChanged));
+ this._strengthChanged.bind(this));
}
this._sync();
_buildUI() {
this.labelItem = new PopupMenu.PopupMenuItem('');
- this.labelItem.connect('activate', Lang.bind(this, this._toggle));
+ this.labelItem.connect('activate', this._toggle.bind(this));
this.radioItem = new PopupMenu.PopupSwitchMenuItem(this._connection.get_id(), false);
- this.radioItem.connect('toggled', Lang.bind(this, this._toggle));
+ this.radioItem.connect('toggled', this._toggle.bind(this));
},
_sync() {
if (this._activeConnection)
this._activeConnectionChangedId = this._activeConnection.connect('vpn-state-changed',
- Lang.bind(this, this._connectionStateChanged));
+ this._connectionStateChanged.bind(this));
this._sync();
},
this.devices = [];
this.section = new PopupMenu.PopupMenuSection();
- this.section.box.connect('actor-added', Lang.bind(this, this._sync));
- this.section.box.connect('actor-removed', Lang.bind(this, this._sync));
+ this.section.box.connect('actor-added', this._sync.bind(this));
+ this.section.box.connect('actor-removed', this._sync.bind(this));
this.addMenuItem(this.section);
this._summaryItem = new PopupMenu.PopupSubMenuMenuItem('', true);
this._ctypes[NM.SETTING_GSM_SETTING_NAME] = NMConnectionCategory.WWAN;
this._ctypes[NM.SETTING_VPN_SETTING_NAME] = NMConnectionCategory.VPN;
- NM.Client.new_async(null, Lang.bind(this, this._clientGot));
+ NM.Client.new_async(null, this._clientGot.bind(this));
},
_clientGot(obj, result) {
}
this._vpnSection = new NMVpnSection(this._client);
- this._vpnSection.connect('activation-failed', Lang.bind(this, this._onActivationFailed));
- this._vpnSection.connect('icon-changed', Lang.bind(this, this._updateIcon));
+ this._vpnSection.connect('activation-failed', this._onActivationFailed.bind(this));
+ this._vpnSection.connect('icon-changed', this._updateIcon.bind(this));
this.menu.addMenuItem(this._vpnSection.item);
this._readConnections();
this._syncMainConnection();
this._syncVpnConnections();
- this._client.connect('notify::nm-running', Lang.bind(this, this._syncNMState));
- this._client.connect('notify::networking-enabled', Lang.bind(this, this._syncNMState));
- this._client.connect('notify::state', Lang.bind(this, this._syncNMState));
- this._client.connect('notify::primary-connection', Lang.bind(this, this._syncMainConnection));
- this._client.connect('notify::activating-connection', Lang.bind(this, this._syncMainConnection));
- this._client.connect('notify::active-connections', Lang.bind(this, this._syncVpnConnections));
- this._client.connect('notify::connectivity', Lang.bind(this, this._syncConnectivity));
- this._client.connect('device-added', Lang.bind(this, this._deviceAdded));
- this._client.connect('device-removed', Lang.bind(this, this._deviceRemoved));
- this._client.connect('connection-added', Lang.bind(this, this._connectionAdded));
- this._client.connect('connection-removed', Lang.bind(this, this._connectionRemoved));
-
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ this._client.connect('notify::nm-running', this._syncNMState.bind(this));
+ this._client.connect('notify::networking-enabled', this._syncNMState.bind(this));
+ this._client.connect('notify::state', this._syncNMState.bind(this));
+ this._client.connect('notify::primary-connection', this._syncMainConnection.bind(this));
+ this._client.connect('notify::activating-connection', this._syncMainConnection.bind(this));
+ this._client.connect('notify::active-connections', this._syncVpnConnections.bind(this));
+ this._client.connect('notify::connectivity', this._syncConnectivity.bind(this));
+ this._client.connect('device-added', this._deviceAdded.bind(this));
+ this._client.connect('device-removed', this._deviceRemoved.bind(this));
+ this._client.connect('connection-added', this._connectionAdded.bind(this));
+ this._client.connect('connection-removed', this._connectionRemoved.bind(this));
+
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
},
_addDeviceWrapper(wrapper) {
wrapper._activationFailedId = wrapper.connect('activation-failed',
- Lang.bind(this, this._onActivationFailed));
+ this._onActivationFailed.bind(this));
let section = this._devices[wrapper.category].section;
section.addMenuItem(wrapper.item);
if (this._mainConnection) {
if (this._mainConnection._primaryDevice)
- this._mainConnectionIconChangedId = this._mainConnection._primaryDevice.connect('icon-changed', Lang.bind(this, this._updateIcon));
- this._mainConnectionStateChangedId = this._mainConnection.connect('notify::state', Lang.bind(this, this._mainConnectionStateChanged));
+ this._mainConnectionIconChangedId = this._mainConnection._primaryDevice.connect('icon-changed', this._updateIcon.bind(this));
+ this._mainConnectionStateChangedId = this._mainConnection.connect('notify::state', this._mainConnectionStateChanged.bind(this));
this._mainConnectionStateChanged();
}
return;
}
- connection._updatedId = connection.connect('changed', Lang.bind(this, this._updateConnection));
+ connection._updatedId = connection.connect('changed', this._updateConnection.bind(this));
this._updateConnection(connection);
this._connections.push(connection);
_readConnections() {
let connections = this._client.get_connections();
- connections.forEach(Lang.bind(this, this._addConnection));
+ connections.forEach(this._addConnection.bind(this));
},
_connectionAdded(client, connection) {
}
this._portalHelperProxy = proxy;
- proxy.connectSignal('Done', Lang.bind(this, this._portalHelperDone));
+ proxy.connectSignal('Done', this._portalHelperDone.bind(this));
proxy.AuthenticateRemote(path, '', timestamp);
});
return;
}
this._proxy.connect('g-properties-changed',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
this._sync();
});
this._item.menu.addSettingsAction(_("Display Settings"), 'gnome-display-panel.desktop');
this.menu.addMenuItem(this._item);
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
this._sync();
},
this._desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
this._desktopSettings.connect('changed::' + SHOW_BATTERY_PERCENTAGE,
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
this._indicator = this._addIndicator();
this._percentageLabel = new St.Label({ y_expand: true,
return;
}
this._proxy.connect('g-properties-changed',
- Lang.bind(this, this._sync));
+ this._sync.bind(this));
this._sync();
});
this._item.menu.addSettingsAction(_("Power Settings"), 'gnome-power-panel.desktop');
this.menu.addMenuItem(this._item);
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
},
return;
}
this._proxy.connect('g-properties-changed',
- Lang.bind(this, this._changed));
+ this._changed.bind(this));
this._changed();
});
},
this.parent();
this._manager = getRfkillManager();
- this._manager.connect('airplane-mode-changed', Lang.bind(this, this._sync));
+ this._manager.connect('airplane-mode-changed', this._sync.bind(this));
this._indicator = this._addIndicator();
this._indicator.icon_name = 'airplane-mode-symbolic';
this._item.menu.addSettingsAction(_("Network Settings"), 'gnome-network-panel.desktop');
this.menu.addMenuItem(this._item);
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
},
this._indicator.add_style_class_name('screencast-indicator');
this._sync();
- Main.screencastService.connect('updated', Lang.bind(this, this._sync));
+ Main.screencastService.connect('updated', this._sync.bind(this));
},
_sync() {
_init(standard, alternate) {
this._standard = standard;
- this._standard.connect('notify::visible', Lang.bind(this, this._sync));
+ this._standard.connect('notify::visible', this._sync.bind(this));
if (this._standard instanceof St.Button)
this._standard.connect('clicked',
() => { this._clickAction.release(); });
this._alternate = alternate;
- this._alternate.connect('notify::visible', Lang.bind(this, this._sync));
+ this._alternate.connect('notify::visible', this._sync.bind(this));
if (this._alternate instanceof St.Button)
this._alternate.connect('clicked',
() => { this._clickAction.release(); });
- this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
+ this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
this._flipped = false;
this._clickAction = new Clutter.ClickAction();
- this._clickAction.connect('long-press', Lang.bind(this, this._onLongPress));
+ this._clickAction.connect('long-press', this._onLongPress.bind(this));
this.actor = new St.Bin();
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('notify::mapped', () => { this._flipped = false; });
},
});
this._updateMultiUser();
- Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+ Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
this._sessionUpdated();
},
this._switchUserSubMenu.menu.addSettingsAction(_("Account Settings"),
'gnome-user-accounts-panel.desktop');
- this._user.connect('notify::is-loaded', Lang.bind(this, this._updateSwitchUserSubMenu));
- this._user.connect('changed', Lang.bind(this, this._updateSwitchUserSubMenu));
+ this._user.connect('notify::is-loaded', this._updateSwitchUserSubMenu.bind(this));
+ this._user.connect('changed', this._updateSwitchUserSubMenu.bind(this));
this.menu.addMenuItem(this._switchUserSubMenu);
Gio.DBus.system,
BOLT_DBUS_NAME,
BOLT_DBUS_PATH,
- Lang.bind(this, this._onProxyReady)
+ this._onProxyReady.bind(this)
);
this.probing = false;
return;
}
this._proxy = proxy;
- this._propsChangedId = this._proxy.connect('g-properties-changed', Lang.bind(this, this._onPropertiesChanged));
- this._deviceAddedId = this._proxy.connectSignal('DeviceAdded', Lang.bind(this, this._onDeviceAdded), true);
+ this._propsChangedId = this._proxy.connect('g-properties-changed', this._onPropertiesChanged.bind(this));
+ this._deviceAddedId = this._proxy.connectSignal('DeviceAdded', this._onDeviceAdded.bind(this));
this.probing = this._proxy.Probing;
if (this.probing)
this._devicesToEnroll = [];
this._enrolling = false;
- this._client.connect('device-added', Lang.bind(this, this._onDeviceAdded));
+ this._client.connect('device-added', this._onDeviceAdded.bind(this));
},
close() {
this.enrolling = true;
GLib.idle_add(GLib.PRIORITY_DEFAULT,
- Lang.bind(this, this._enrollDevicesIdle));
+ this._enrollDevicesIdle.bind(this));
},
_onEnrollDone(device, error) {
if (this._enrolling)
GLib.idle_add(GLib.PRIORITY_DEFAULT,
- Lang.bind(this, this._enrollDevicesIdle));
+ this._enrollDevicesIdle.bind(this));
},
_enrollDevicesIdle() {
this._client.enrollDevice(dev.Uid,
Policy.DEFAULT,
- Lang.bind(this, this._onEnrollDone));
+ this._onEnrollDone.bind(this));
return GLib.SOURCE_REMOVE;
}
this._indicator.icon_name = 'thunderbolt-symbolic';
this._client = new Client();
- this._client.connect('probing-changed', Lang.bind(this, this._onProbing));
+ this._client.connect('probing-changed', this._onProbing.bind(this));
this._robot = new AuthRobot(this._client);
- this._robot.connect('enroll-device', Lang.bind(this, this._onEnrollDevice));
- this._robot.connect('enroll-failed', Lang.bind(this, this._onEnrollFailed));
+ this._robot.connect('enroll-device', this._onEnrollDevice.bind(this));
+ this._robot.connect('enroll-failed', this._onEnrollFailed.bind(this));
- Main.sessionMode.connect('updated', Lang.bind(this, this._sync));
+ Main.sessionMode.connect('updated', this._sync.bind(this));
this._sync();
this._source = null;
this.item = new PopupMenu.PopupBaseMenuItem({ activate: false });
this._slider = new Slider.Slider(0);
- this._slider.connect('value-changed', Lang.bind(this, this._sliderChanged));
- this._slider.connect('drag-end', Lang.bind(this, this._notifyVolumeChange));
+ this._slider.connect('value-changed', this._sliderChanged.bind(this));
+ this._slider.connect('drag-end', this._notifyVolumeChange.bind(this));
this._icon = new St.Icon({ style_class: 'popup-menu-icon' });
this.item.actor.add(this._icon);
},
_connectStream(stream) {
- this._mutedChangedId = stream.connect('notify::is-muted', Lang.bind(this, this._updateVolume));
- this._volumeChangedId = stream.connect('notify::volume', Lang.bind(this, this._updateVolume));
+ this._mutedChangedId = stream.connect('notify::is-muted', this._updateVolume.bind(this));
+ this._volumeChangedId = stream.connect('notify::volume', this._updateVolume.bind(this));
},
_shouldBeVisible() {
_connectStream(stream) {
this.parent(stream);
- this._portChangedId = stream.connect('notify::port', Lang.bind(this, this._portChanged));
+ this._portChangedId = stream.connect('notify::port', this._portChanged.bind(this));
this._portChanged();
},
_init(control) {
this.parent(control);
this._slider.actor.accessible_name = _("Microphone");
- this._control.connect('stream-added', Lang.bind(this, this._maybeShowInput));
- this._control.connect('stream-removed', Lang.bind(this, this._maybeShowInput));
+ this._control.connect('stream-added', this._maybeShowInput.bind(this));
+ this._control.connect('stream-removed', this._maybeShowInput.bind(this));
this._icon.icon_name = 'audio-input-microphone-symbolic';
},
this.hasHeadphones = false;
this._control = control;
- this._control.connect('state-changed', Lang.bind(this, this._onControlStateChanged));
- this._control.connect('default-sink-changed', Lang.bind(this, this._readOutput));
- this._control.connect('default-source-changed', Lang.bind(this, this._readInput));
+ this._control.connect('state-changed', this._onControlStateChanged.bind(this));
+ this._control.connect('default-sink-changed', this._readOutput.bind(this));
+ this._control.connect('default-source-changed', this._readInput.bind(this));
this._output = new OutputStreamSlider(this._control);
this._output.connect('stream-updated', () => {
this.menu.addMenuItem(this._volumeMenu);
- this.indicators.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
+ this.indicators.connect('scroll-event', this._onScrollEvent.bind(this));
},
_onScrollEvent(actor, event) {
this.actor = new Shell.GenericContainer({ style_class: 'switcher-popup',
reactive: true,
visible: false });
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocate));
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocate.bind(this));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
Main.uiGroup.add_actor(this.actor);
this._haveModal = true;
this._modifierMask = primaryModifier(mask);
- this.actor.connect('key-press-event', Lang.bind(this, this._keyPressEvent));
- this.actor.connect('key-release-event', Lang.bind(this, this._keyReleaseEvent));
+ this.actor.connect('key-press-event', this._keyPressEvent.bind(this));
+ this.actor.connect('key-release-event', this._keyReleaseEvent.bind(this));
- this.actor.connect('button-press-event', Lang.bind(this, this._clickedOutside));
- this.actor.connect('scroll-event', Lang.bind(this, this._scrollEvent));
+ this.actor.connect('button-press-event', this._clickedOutside.bind(this));
+ this.actor.connect('scroll-event', this._scrollEvent.bind(this));
this.actor.add_actor(this._switcherList.actor);
- this._switcherList.connect('item-activated', Lang.bind(this, this._itemActivated));
- this._switcherList.connect('item-entered', Lang.bind(this, this._itemEntered));
- this._switcherList.connect('item-removed', Lang.bind(this, this._itemRemoved));
+ this._switcherList.connect('item-activated', this._itemActivated.bind(this));
+ this._switcherList.connect('item-entered', this._itemEntered.bind(this));
+ this._switcherList.connect('item-removed', this._itemRemoved.bind(this));
// Need to force an allocation so we can figure out whether we
// need to scroll when selecting
if (this._motionTimeoutId != 0)
Mainloop.source_remove(this._motionTimeoutId);
- this._motionTimeoutId = Mainloop.timeout_add(DISABLE_HOVER_TIMEOUT, Lang.bind(this, this._mouseTimedOut));
+ this._motionTimeoutId = Mainloop.timeout_add(DISABLE_HOVER_TIMEOUT, this._mouseTimedOut.bind(this));
GLib.Source.set_name_by_id(this._motionTimeoutId, '[gnome-shell] this._mouseTimedOut');
},
_init(squareItems) {
this.actor = new Shell.GenericContainer({ style_class: 'switcher-list' });
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocateTop));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocateTop.bind(this));
// Here we use a GenericContainer so that we can force all the
// children to have the same width.
this._list.spacing = this._list.get_theme_node().get_length('spacing');
});
- this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this._list.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this._list.connect('allocate', Lang.bind(this, this._allocate));
+ this._list.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this._list.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this._list.connect('allocate', this._allocate.bind(this));
this._scrollView = new St.ScrollView({ style_class: 'hfade',
enable_mouse_scrolling: false });
this.actor.add_child(this._promptBox);
this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
- this._authPrompt.connect('failed', Lang.bind(this, this._fail));
- this._authPrompt.connect('cancelled', Lang.bind(this, this._fail));
- this._authPrompt.connect('reset', Lang.bind(this, this._onReset));
+ this._authPrompt.connect('failed', this._fail.bind(this));
+ this._authPrompt.connect('cancelled', this._fail.bind(this));
+ this._authPrompt.connect('reset', this._onReset.bind(this));
this._authPrompt.setPasswordChar('\u25cf');
this._authPrompt.nextButton.label = _("Unlock");
reactive: true,
x_align: St.Align.START,
x_fill: false });
- this._otherUserButton.connect('clicked', Lang.bind(this, this._otherUserClicked));
+ this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this));
this._promptBox.add_child(this._otherUserButton);
} else {
this._otherUserButton = null;
Main.ctrlAltTabManager.addGroup(this.actor, _("Unlock Window"), 'dialog-password-symbolic');
this._idleMonitor = Meta.IdleMonitor.get_core();
- this._idleWatchId = this._idleMonitor.add_idle_watch(IDLE_TIMEOUT * 1000, Lang.bind(this, this._escape));
+ this._idleWatchId = this._idleMonitor.add_idle_watch(IDLE_TIMEOUT * 1000, this._escape.bind(this));
},
_updateSensitivity(sensitive) {
// Monitor the scaling factor to make sure we recreate the avatar when needed.
let themeContext = St.ThemeContext.get_for_stage(global.stage);
- themeContext.connect('notify::scale-factor', Lang.bind(this, this.update));
+ themeContext.connect('notify::scale-factor', this.update.bind(this));
},
setSensitive(sensitive) {
this._currentLabel = null;
- this._userLoadedId = this._user.connect('notify::is-loaded', Lang.bind(this, this._updateUser));
- this._userChangedId = this._user.connect('changed', Lang.bind(this, this._updateUser));
+ this._userLoadedId = this._user.connect('notify::is-loaded', this._updateUser.bind(this));
+ this._userChangedId = this._user.connect('changed', this._updateUser.bind(this));
this._updateUser();
// We can't override the destroy vfunc because that might be called during
// so we use a signal, that will be disconnected by GObject the first time
// the actor is destroyed (which is guaranteed to be as part of a normal
// destroy() call from JS, possibly from some ancestor)
- this.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.connect('destroy', this._onDestroy.bind(this));
},
_onDestroy() {
this.actor = new St.BoxLayout({ style_class: 'user-widget',
vertical: false });
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._avatar = new Avatar(user);
this.actor.add_child(this._avatar.actor);
this._label.bind_property('label-actor', this.actor, 'label-actor',
GObject.BindingFlags.SYNC_CREATE);
- this._userLoadedId = this._user.connect('notify::is-loaded', Lang.bind(this, this._updateUser));
- this._userChangedId = this._user.connect('changed', Lang.bind(this, this._updateUser));
+ this._userLoadedId = this._user.connect('notify::is-loaded', this._updateUser.bind(this));
+ this._userChangedId = this._user.connect('changed', this._updateUser.bind(this));
this._updateUser();
},
Name: 'TouchpadShowOverviewAction',
_init(actor) {
- actor.connect('captured-event', Lang.bind(this, this._handleEvent));
+ actor.connect('captured-event', this._handleEvent.bind(this));
},
_handleEvent(actor, event) {
this.actor = new Shell.Stack({ name: 'viewSelector' });
this._showAppsButton = showAppsButton;
- this._showAppsButton.connect('notify::checked', Lang.bind(this, this._onShowAppsButtonToggled));
+ this._showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this));
this._activePage = null;
ShellEntry.addContextMenu(this._entry);
this._text = this._entry.clutter_text;
- this._text.connect('text-changed', Lang.bind(this, this._onTextChanged));
- this._text.connect('key-press-event', Lang.bind(this, this._onKeyPress));
+ this._text.connect('text-changed', this._onTextChanged.bind(this));
+ this._text.connect('key-press-event', this._onKeyPress.bind(this));
this._text.connect('key-focus-in', () => {
this._searchResults.highlightDefault(true);
});
this._entry.menu.close();
this._searchResults.popupMenuDefault();
});
- this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped));
- global.stage.connect('notify::key-focus', Lang.bind(this, this._onStageKeyFocusChanged));
+ this._entry.connect('notify::mapped', this._onMapped.bind(this));
+ global.stage.connect('notify::key-focus', this._onStageKeyFocusChanged.bind(this));
this._entry.set_primary_icon(new St.Icon({ style_class: 'search-entry-icon',
icon_name: 'edit-find-symbolic' }));
this._stageKeyPressId = 0;
Main.overview.connect('showing', () => {
this._stageKeyPressId = global.stage.connect('key-press-event',
- Lang.bind(this, this._onStageKeyPress));
+ this._onStageKeyPress.bind(this));
});
Main.overview.connect('hiding', () => {
if (this._stageKeyPressId != 0) {
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._toggleAppsPage));
+ this._toggleAppsPage.bind(this));
Main.wm.addKeybinding('toggle-overview',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(Main.overview, Main.overview.toggle));
+ Main.overview.toggle.bind(Main.overview));
let side;
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
global.stage.add_action(gesture);
gesture = new ShowOverviewAction();
- gesture.connect('activated', Lang.bind(this, this._pinchGestureActivated));
+ gesture.connect('activated', this._pinchGestureActivated.bind(this));
global.stage.add_action(gesture);
gesture = new TouchpadShowOverviewAction(global.stage);
- gesture.connect('activated', Lang.bind(this, this._pinchGestureActivated));
+ gesture.connect('activated', this._pinchGestureActivated.bind(this));
},
_pinchGestureActivated(action, scale) {
if (this._entry.mapped) {
// Enable 'find-as-you-type'
this._capturedEventId = global.stage.connect('captured-event',
- Lang.bind(this, this._onCapturedEvent));
+ this._onCapturedEvent.bind(this));
this._text.set_cursor_visible(true);
this._text.set_selection(0, 0);
} else {
if (this._iconClickedId == 0)
this._iconClickedId = this._entry.connect('secondary-icon-clicked',
- Lang.bind(this, this.reset));
+ this.reset.bind(this));
} else {
if (this._iconClickedId > 0) {
this._entry.disconnect(this._iconClickedId);
_init() {
this._tracker = Shell.WindowTracker.get_default();
this._windowDemandsAttentionId = global.display.connect('window-demands-attention',
- Lang.bind(this, this._onWindowDemandsAttention));
+ this._onWindowDemandsAttention.bind(this));
},
_getTitleAndBanner(app, window) {
this.signalIDs.push(this._window.connect('unmanaged',
() => { this.destroy(); }));
- this.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.connect('destroy', this._onDestroy.bind(this));
},
_onDestroy() {
to avoid ellipsizing the labels.
*/
this._cancelButton = this.addButton({ label: _("Revert Settings"),
- action: Lang.bind(this, this._onFailure),
+ action: this._onFailure.bind(this),
key: Clutter.Escape });
this._okButton = this.addButton({ label: _("Keep Changes"),
- action: Lang.bind(this, this._onSuccess),
+ action: this._onSuccess.bind(this),
default: true });
- this._timeoutId = Mainloop.timeout_add(ONE_SECOND, Lang.bind(this, this._tick));
+ this._timeoutId = Mainloop.timeout_add(ONE_SECOND, this._tick.bind(this));
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._tick');
},
this._pauseWorkspaceCheck = false;
let tracker = Shell.WindowTracker.get_default();
- tracker.connect('startup-sequence-changed', Lang.bind(this, this._queueCheckWorkspaces));
+ tracker.connect('startup-sequence-changed', this._queueCheckWorkspaces.bind(this));
- global.screen.connect('notify::n-workspaces', Lang.bind(this, this._nWorkspacesChanged));
- global.window_manager.connect('switch-workspace', Lang.bind(this, this._queueCheckWorkspaces));
+ global.screen.connect('notify::n-workspaces', this._nWorkspacesChanged.bind(this));
+ global.window_manager.connect('switch-workspace', this._queueCheckWorkspaces.bind(this));
- global.screen.connect('window-entered-monitor', Lang.bind(this, this._windowEnteredMonitor));
- global.screen.connect('window-left-monitor', Lang.bind(this, this._windowLeftMonitor));
- global.screen.connect('restacked', Lang.bind(this, this._windowsRestacked));
+ global.screen.connect('window-entered-monitor', this._windowEnteredMonitor.bind(this));
+ global.screen.connect('window-left-monitor', this._windowLeftMonitor.bind(this));
+ global.screen.connect('restacked', this._windowsRestacked.bind(this));
this._workspaceSettings = this._getWorkspaceSettings();
- this._workspaceSettings.connect('changed::dynamic-workspaces', Lang.bind(this, this._queueCheckWorkspaces));
+ this._workspaceSettings.connect('changed::dynamic-workspaces', this._queueCheckWorkspaces.bind(this));
this._nWorkspacesChanged();
},
_queueCheckWorkspaces() {
if (this._checkWorkspacesId == 0)
- this._checkWorkspacesId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, this._checkWorkspaces));
+ this._checkWorkspacesId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, this._checkWorkspaces.bind(this));
},
_nWorkspacesChanged() {
for (w = oldNumWorkspaces; w < newNumWorkspaces; w++) {
let workspace = this._workspaces[w];
- workspace._windowAddedId = workspace.connect('window-added', Lang.bind(this, this._queueCheckWorkspaces));
- workspace._windowRemovedId = workspace.connect('window-removed', Lang.bind(this, this._windowRemoved));
+ workspace._windowAddedId = workspace.connect('window-added', this._queueCheckWorkspaces.bind(this));
+ workspace._windowRemovedId = workspace.connect('window-removed', this._windowRemoved.bind(this));
}
} else {
{ opacity: 0,
time: WINDOW_ANIMATION_TIME,
transition: 'easeOutQuad',
- onComplete: Lang.bind(this, this._reset)
+ onComplete: this._reset.bind(this)
});
},
_init(actor) {
this._dx = 0;
this._dy = 0;
- actor.connect('captured-event', Lang.bind(this, this._handleEvent));
+ actor.connect('captured-event', this._handleEvent.bind(this));
},
_checkActivated() {
this._isWorkspacePrepended = false;
this._switchData = null;
- this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
+ this._shellwm.connect('kill-switch-workspace', this._switchWorkspaceDone.bind(this));
this._shellwm.connect('kill-window-effects', (shellwm, actor) => {
this._minimizeWindowDone(shellwm, actor);
this._mapWindowDone(shellwm, actor);
this._sizeChangeWindowDone(shellwm, actor);
});
- this._shellwm.connect('switch-workspace', Lang.bind(this, this._switchWorkspace));
- this._shellwm.connect('show-tile-preview', Lang.bind(this, this._showTilePreview));
- this._shellwm.connect('hide-tile-preview', Lang.bind(this, this._hideTilePreview));
- this._shellwm.connect('show-window-menu', Lang.bind(this, this._showWindowMenu));
- this._shellwm.connect('minimize', Lang.bind(this, this._minimizeWindow));
- this._shellwm.connect('unminimize', Lang.bind(this, this._unminimizeWindow));
- this._shellwm.connect('size-change', Lang.bind(this, this._sizeChangeWindow));
- this._shellwm.connect('size-changed', Lang.bind(this, this._sizeChangedWindow));
- this._shellwm.connect('map', Lang.bind(this, this._mapWindow));
- this._shellwm.connect('destroy', Lang.bind(this, this._destroyWindow));
- this._shellwm.connect('filter-keybinding', Lang.bind(this, this._filterKeybinding));
- this._shellwm.connect('confirm-display-change', Lang.bind(this, this._confirmDisplayChange));
- this._shellwm.connect('create-close-dialog', Lang.bind(this, this._createCloseDialog));
- this._shellwm.connect('create-inhibit-shortcuts-dialog', Lang.bind(this, this._createInhibitShortcutsDialog));
- global.screen.connect('restacked', Lang.bind(this, this._syncStacking));
+ this._shellwm.connect('switch-workspace', this._switchWorkspace.bind(this));
+ this._shellwm.connect('show-tile-preview', this._showTilePreview.bind(this));
+ this._shellwm.connect('hide-tile-preview', this._hideTilePreview.bind(this));
+ this._shellwm.connect('show-window-menu', this._showWindowMenu.bind(this));
+ this._shellwm.connect('minimize', this._minimizeWindow.bind(this));
+ this._shellwm.connect('unminimize', this._unminimizeWindow.bind(this));
+ this._shellwm.connect('size-change', this._sizeChangeWindow.bind(this));
+ this._shellwm.connect('size-changed', this._sizeChangedWindow.bind(this));
+ this._shellwm.connect('map', this._mapWindow.bind(this));
+ this._shellwm.connect('destroy', this._destroyWindow.bind(this));
+ this._shellwm.connect('filter-keybinding', this._filterKeybinding.bind(this));
+ this._shellwm.connect('confirm-display-change', this._confirmDisplayChange.bind(this));
+ this._shellwm.connect('create-close-dialog', this._createCloseDialog.bind(this));
+ this._shellwm.connect('create-inhibit-shortcuts-dialog', this._createInhibitShortcutsDialog.bind(this));
+ global.screen.connect('restacked', this._syncStacking.bind(this));
this._workspaceSwitcherPopup = null;
this._tilePreview = null;
this.setCustomKeybindingHandler('switch-to-workspace-left',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-right',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-up',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-down',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-last',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-left',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-right',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-up',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-down',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-1',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-2',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-3',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-4',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-5',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-6',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-7',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-8',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-9',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-10',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-11',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-12',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-1',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-2',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-3',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-4',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-5',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-6',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-7',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-8',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-9',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-10',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-11',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-12',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-last',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._showWorkspaceSwitcher));
+ this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-applications',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-group',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-applications-backward',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-group-backward',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-windows',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-windows-backward',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-windows',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-windows-backward',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-group',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-group-backward',
Shell.ActionMode.NORMAL,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-panels',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW |
Shell.ActionMode.LOCK_SCREEN |
Shell.ActionMode.UNLOCK_SCREEN |
Shell.ActionMode.LOGIN_SCREEN,
- Lang.bind(this, this._startA11ySwitcher));
+ this._startA11ySwitcher.bind(this));
this.setCustomKeybindingHandler('switch-panels-backward',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW |
Shell.ActionMode.LOCK_SCREEN |
Shell.ActionMode.UNLOCK_SCREEN |
Shell.ActionMode.LOGIN_SCREEN,
- Lang.bind(this, this._startA11ySwitcher));
+ this._startA11ySwitcher.bind(this));
this.setCustomKeybindingHandler('switch-monitor',
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW,
- Lang.bind(this, this._startSwitcher));
+ this._startSwitcher.bind(this));
this.addKeybinding('pause-resume-tweens',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.ALL,
- Lang.bind(this, this._toggleTweens));
+ this._toggleTweens.bind(this));
this.addKeybinding('open-application-menu',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
Shell.ActionMode.NORMAL |
Shell.ActionMode.POPUP,
- Lang.bind(this, this._toggleAppMenu));
+ this._toggleAppMenu.bind(this));
this.addKeybinding('toggle-message-tray',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW |
Shell.ActionMode.POPUP,
- Lang.bind(this, this._toggleCalendar));
+ this._toggleCalendar.bind(this));
- global.display.connect('show-resize-popup', Lang.bind(this, this._showResizePopup));
- global.display.connect('show-pad-osd', Lang.bind(this, this._showPadOsd));
+ global.display.connect('show-resize-popup', this._showResizePopup.bind(this));
+ global.display.connect('show-pad-osd', this._showPadOsd.bind(this));
global.display.connect('show-osd', (display, monitorIndex, iconName, label) => {
let icon = Gio.Icon.new_for_string(iconName);
Main.osdWindowManager.show(monitorIndex, icon, label, null);
false, -1, 1);
let gesture = new WorkspaceSwitchAction();
- gesture.connect('activated', Lang.bind(this, this._actionSwitchWorkspace));
+ gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
global.stage.add_action(gesture);
// This is not a normal Clutter.GestureAction, doesn't need add_action()
gesture = new TouchpadWorkspaceSwitchAction(global.stage);
- gesture.connect('activated', Lang.bind(this, this._actionSwitchWorkspace));
+ gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
gesture = new AppSwitchAction();
- gesture.connect('activated', Lang.bind(this, this._switchApp));
+ gesture.connect('activated', this._switchApp.bind(this));
global.stage.add_action(gesture);
let mode = Shell.ActionMode.ALL & ~Shell.ActionMode.LOCK_SCREEN;
this._stackAbove = null;
this._windowClone._updateId = this.metaWindow.connect('size-changed',
- Lang.bind(this, this._onRealWindowSizeChanged));
+ this._onRealWindowSizeChanged.bind(this));
this._windowClone._destroyId =
this.realWindow.connect('destroy', () => {
// First destroy the clone and then destroy everything
this.actor.y = this._boundingBox.y;
let clickAction = new Clutter.ClickAction();
- clickAction.connect('clicked', Lang.bind(this, this._onClicked));
- clickAction.connect('long-press', Lang.bind(this, this._onLongPress));
+ clickAction.connect('clicked', this._onClicked.bind(this));
+ clickAction.connect('long-press', this._onLongPress.bind(this));
this.actor.add_action(clickAction);
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
- this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
+ this.actor.connect('key-press-event', this._onKeyPress.bind(this));
this.actor.connect('enter-event', () => { this.emit('show-chrome'); });
this.actor.connect('key-focus-in', () => { this.emit('show-chrome'); });
manualMode: true,
dragActorMaxSize: WINDOW_DND_SIZE,
dragActorOpacity: DRAGGING_WINDOW_OPACITY });
- this._draggable.connect('drag-begin', Lang.bind(this, this._onDragBegin));
- this._draggable.connect('drag-cancelled', Lang.bind(this, this._onDragCancelled));
- this._draggable.connect('drag-end', Lang.bind(this, this._onDragEnd));
+ this._draggable.connect('drag-begin', this._onDragBegin.bind(this));
+ this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this));
+ this._draggable.connect('drag-end', this._onDragEnd.bind(this));
this.inDrag = false;
this._selected = false;
button._overlap = 0;
this._idleToggleCloseId = 0;
- button.connect('clicked', Lang.bind(this, this._closeWindow));
+ button.connect('clicked', this._closeWindow.bind(this));
- windowClone.actor.connect('destroy', Lang.bind(this, this._onDestroy));
- windowClone.connect('show-chrome', Lang.bind(this, this._onShowChrome));
- windowClone.connect('hide-chrome', Lang.bind(this, this._onHideChrome));
+ windowClone.actor.connect('destroy', this._onDestroy.bind(this));
+ windowClone.connect('show-chrome', this._onShowChrome.bind(this));
+ windowClone.connect('hide-chrome', this._onHideChrome.bind(this));
this._windowAddedId = 0;
parentActor.add_actor(this.title);
parentActor.add_actor(this.closeButton);
title.connect('style-changed',
- Lang.bind(this, this._onStyleChanged));
+ this._onStyleChanged.bind(this));
button.connect('style-changed',
- Lang.bind(this, this._onStyleChanged));
- this.border.connect('style-changed', Lang.bind(this, this._onStyleChanged));
+ this._onStyleChanged.bind(this));
+ this.border.connect('style-changed', this._onStyleChanged.bind(this));
// force a style change if we are already on a stage - otherwise
// the signal will be emitted normally when we are added
if (parentActor.get_stage())
this._workspace = metaWindow.get_workspace();
this._windowAddedId = this._workspace.connect('window-added',
- Lang.bind(this,
- this._onWindowAdded));
+ this._onWindowAdded.bind(this));
this._windowClone.deleteAll();
},
_onHideChrome() {
if (this._idleToggleCloseId == 0) {
- this._idleToggleCloseId = Mainloop.timeout_add(750, Lang.bind(this, this._idleToggleCloseButton));
+ this._idleToggleCloseId = Mainloop.timeout_add(750, this._idleToggleCloseButton.bind(this));
GLib.Source.set_name_by_id(this._idleToggleCloseId, '[gnome-shell] this._idleToggleCloseButton');
}
},
this.actor.add_actor(this._dropRect);
this.actor.add_actor(this._windowOverlaysGroup);
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
let windows = global.get_window_actors().filter(this._isMyWindow, this);
// Track window changes
if (this.metaWorkspace) {
this._windowAddedId = this.metaWorkspace.connect('window-added',
- Lang.bind(this, this._windowAdded));
+ this._windowAdded.bind(this));
this._windowRemovedId = this.metaWorkspace.connect('window-removed',
- Lang.bind(this, this._windowRemoved));
+ this._windowRemoved.bind(this));
}
this._windowEnteredMonitorId = global.screen.connect('window-entered-monitor',
- Lang.bind(this, this._windowEnteredMonitor));
+ this._windowEnteredMonitor.bind(this));
this._windowLeftMonitorId = global.screen.connect('window-left-monitor',
- Lang.bind(this, this._windowLeftMonitor));
+ this._windowLeftMonitor.bind(this));
this._repositionWindowsId = 0;
this.leavingOverview = false;
this._currentLayout = null;
this._repositionWindowsId = Mainloop.timeout_add(750,
- Lang.bind(this, this._delayedWindowRepositioning));
+ this._delayedWindowRepositioning.bind(this));
GLib.Source.set_name_by_id(this._repositionWindowsId, '[gnome-shell] this._delayedWindowRepositioning');
},
fadeToOverview() {
// We don't want to reposition windows while animating in this way.
this._animatingWindowsFade = true;
- this._overviewShownId = Main.overview.connect('shown', Lang.bind(this,
- this._doneShowingOverview));
+ this._overviewShownId = Main.overview.connect('shown', this._doneShowingOverview.bind(this));
if (this._windows.length == 0)
return;
fadeFromOverview() {
this.leavingOverview = true;
- this._overviewHiddenId = Main.overview.connect('hidden', Lang.bind(this,
- this._doneLeavingOverview));
+ this._overviewHiddenId = Main.overview.connect('hidden', this._doneLeavingOverview.bind(this));
if (this._windows.length == 0)
return;
Mainloop.source_remove(this._repositionWindowsId);
this._repositionWindowsId = 0;
}
- this._overviewHiddenId = Main.overview.connect('hidden', Lang.bind(this,
- this._doneLeavingOverview));
+ this._overviewHiddenId = Main.overview.connect('hidden', this._doneLeavingOverview.bind(this));
if (this.metaWorkspace != null && this.metaWorkspace != currentWorkspace)
return;
clone.positioned = positioned;
clone.connect('selected',
- Lang.bind(this, this._onCloneSelected));
+ this._onCloneSelected.bind(this));
clone.connect('drag-begin', () => {
Main.overview.beginWindowDrag(clone.metaWindow);
overlay.hide();
this.actor.add_actor(clone.actor);
- overlay.connect('show-close-button', Lang.bind(this, this._onShowOverlayClose));
+ overlay.connect('show-close-button', this._onShowOverlayClose.bind(this));
if (this._windows.length == 0)
clone.setStackAbove(null);
this._itemSpacing = this._list.get_theme_node().get_length('spacing');
});
- this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this._list.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this._list.connect('allocate', Lang.bind(this, this._allocate));
+ this._list.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this._list.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this._list.connect('allocate', this._allocate.bind(this));
this._container.add(this._list);
this.actor.add_actor(this._container);
this.actor.hide();
this._globalSignals = [];
- this._globalSignals.push(global.screen.connect('workspace-added', Lang.bind(this, this._redisplay)));
- this._globalSignals.push(global.screen.connect('workspace-removed', Lang.bind(this, this._redisplay)));
+ this._globalSignals.push(global.screen.connect('workspace-added', this._redisplay.bind(this)));
+ this._globalSignals.push(global.screen.connect('workspace-removed', this._redisplay.bind(this)));
},
_getPreferredHeight(actor, forWidth, alloc) {
this._redisplay();
if (this._timeoutId != 0)
Mainloop.source_remove(this._timeoutId);
- this._timeoutId = Mainloop.timeout_add(DISPLAY_TIMEOUT, Lang.bind(this, this._onTimeout));
+ this._timeoutId = Mainloop.timeout_add(DISPLAY_TIMEOUT, this._onTimeout.bind(this));
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] this._onTimeout');
this._show();
},
this.metaWindow = realWindow.meta_window;
this.clone._updateId = this.metaWindow.connect('position-changed',
- Lang.bind(this, this._onPositionChanged));
+ this._onPositionChanged.bind(this));
this.clone._destroyId = this.realWindow.connect('destroy', () => {
// First destroy the clone and then destroy everything
// This will ensure that we never see it in the _disconnectSignals loop
this._onPositionChanged();
this.actor.connect('button-release-event',
- Lang.bind(this, this._onButtonRelease));
+ this._onButtonRelease.bind(this));
this.actor.connect('touch-event',
- Lang.bind(this, this._onTouchEvent));
+ this._onTouchEvent.bind(this));
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._draggable = DND.makeDraggable(this.actor,
{ restoreOnSuccess: true,
dragActorMaxSize: Workspace.WINDOW_DND_SIZE,
dragActorOpacity: Workspace.DRAGGING_WINDOW_OPACITY });
- this._draggable.connect('drag-begin', Lang.bind(this, this._onDragBegin));
- this._draggable.connect('drag-cancelled', Lang.bind(this, this._onDragCancelled));
- this._draggable.connect('drag-end', Lang.bind(this, this._onDragEnd));
+ this._draggable.connect('drag-begin', this._onDragBegin.bind(this));
+ this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this));
+ this._draggable.connect('drag-end', this._onDragEnd.bind(this));
this.inDrag = false;
let iter = win => {
let clone = new Clutter.Clone({ source: realDialog });
this._updateDialogPosition(realDialog, clone);
- clone._updateId = metaDialog.connect('position-changed',
- Lang.bind(this, this._updateDialogPosition, clone));
+ clone._updateId = metaDialog.connect('position-changed', dialog => {
+ this._updateDialogPosition(dialog, clone);
+ });
clone._destroyId = realDialog.connect('destroy', () => {
clone.destroy();
});
this._contents = new Clutter.Actor();
this.actor.add_child(this._contents);
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
this._createBackground();
for (let i = 0; i < windows.length; i++) {
let minimizedChangedId =
windows[i].meta_window.connect('notify::minimized',
- Lang.bind(this,
- this._updateMinimized));
+ this._updateMinimized.bind(this));
this._allWindows.push(windows[i].meta_window);
this._minimizedChangedIds.push(minimizedChangedId);
// Track window changes
this._windowAddedId = this.metaWorkspace.connect('window-added',
- Lang.bind(this, this._windowAdded));
+ this._windowAdded.bind(this));
this._windowRemovedId = this.metaWorkspace.connect('window-removed',
- Lang.bind(this, this._windowRemoved));
+ this._windowRemoved.bind(this));
this._windowEnteredMonitorId = global.screen.connect('window-entered-monitor',
- Lang.bind(this, this._windowEnteredMonitor));
+ this._windowEnteredMonitor.bind(this));
this._windowLeftMonitorId = global.screen.connect('window-left-monitor',
- Lang.bind(this, this._windowLeftMonitor));
+ this._windowLeftMonitor.bind(this));
this.state = ThumbnailState.NORMAL;
this._slidePosition = 0; // Fully slid in
if (this._allWindows.indexOf(metaWin) == -1) {
let minimizedChangedId = metaWin.connect('notify::minimized',
- Lang.bind(this,
- this._updateMinimized));
+ this._updateMinimized.bind(this));
this._allWindows.push(metaWin);
this._minimizedChangedIds.push(minimizedChangedId);
}
this.actor = new Shell.GenericContainer({ reactive: true,
style_class: 'workspace-thumbnails',
request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT });
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocate));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocate.bind(this));
this.actor._delegate = this;
let indicator = new St.Bin({ style_class: 'workspace-thumbnail-indicator' });
this._thumbnails = [];
this.actor.connect('button-press-event', () => Clutter.EVENT_STOP);
- this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
- this.actor.connect('touch-event', Lang.bind(this, this._onTouchEvent));
+ this.actor.connect('button-release-event', this._onButtonRelease.bind(this));
+ this.actor.connect('touch-event', this._onTouchEvent.bind(this));
Main.overview.connect('showing',
- Lang.bind(this, this._createThumbnails));
+ this._createThumbnails.bind(this));
Main.overview.connect('hidden',
- Lang.bind(this, this._destroyThumbnails));
+ this._destroyThumbnails.bind(this));
Main.overview.connect('item-drag-begin',
- Lang.bind(this, this._onDragBegin));
+ this._onDragBegin.bind(this));
Main.overview.connect('item-drag-end',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.overview.connect('item-drag-cancelled',
- Lang.bind(this, this._onDragCancelled));
+ this._onDragCancelled.bind(this));
Main.overview.connect('window-drag-begin',
- Lang.bind(this, this._onDragBegin));
+ this._onDragBegin.bind(this));
Main.overview.connect('window-drag-end',
- Lang.bind(this, this._onDragEnd));
+ this._onDragEnd.bind(this));
Main.overview.connect('window-drag-cancelled',
- Lang.bind(this, this._onDragCancelled));
+ this._onDragCancelled.bind(this));
this._settings = new Gio.Settings({ schema_id: OVERRIDE_SCHEMA });
this._settings.connect('changed::dynamic-workspaces',
- Lang.bind(this, this._updateSwitcherVisibility));
+ this._updateSwitcherVisibility.bind(this));
Main.layoutManager.connect('monitors-changed', () => {
this._destroyThumbnails();
_onDragBegin() {
this._dragCancelled = false;
this._dragMonitor = {
- dragMotion: Lang.bind(this, this._onDragMotion)
+ dragMotion: this._onDragMotion.bind(this)
};
DND.addDragMonitor(this._dragMonitor);
},
_createThumbnails() {
this._switchWorkspaceNotifyId =
global.window_manager.connect('switch-workspace',
- Lang.bind(this, this._activeWorkspaceChanged));
+ this._activeWorkspaceChanged.bind(this));
this._nWorkspacesNotifyId =
global.screen.connect('notify::n-workspaces',
- Lang.bind(this, this._workspacesChanged));
+ this._workspacesChanged.bind(this));
this._syncStackingId =
Main.overview.connect('windows-restacked',
- Lang.bind(this, this._syncStacking));
+ this._syncStacking.bind(this));
this._targetScale = 0;
this._scale = 0;
return;
Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
- Lang.bind(this, this._updateStates));
+ this._updateStates.bind(this));
this._stateUpdateQueued = true;
},
_init(monitorIndex) {
this.actor = new St.Widget({ style_class: 'workspaces-view',
reactive: true });
- this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+ this.actor.connect('destroy', this._onDestroy.bind(this));
global.focus_manager.add_group(this.actor);
// The actor itself isn't a drop target, so we don't want to pick on its area
this._actualGeometry = null;
this._inDrag = false;
- this._windowDragBeginId = Main.overview.connect('window-drag-begin', Lang.bind(this, this._dragBegin));
- this._windowDragEndId = Main.overview.connect('window-drag-end', Lang.bind(this, this._dragEnd));
+ this._windowDragBeginId = Main.overview.connect('window-drag-begin', this._dragBegin.bind(this));
+ this._windowDragEndId = Main.overview.connect('window-drag-end', this._dragEnd.bind(this));
},
_onDestroy() {
step_increment: 0,
upper: global.screen.n_workspaces });
this.scrollAdjustment.connect('notify::value',
- Lang.bind(this, this._onScroll));
+ this._onScroll.bind(this));
this._workspaces = [];
this._updateWorkspaces();
- this._updateWorkspacesId = global.screen.connect('notify::n-workspaces', Lang.bind(this, this._updateWorkspaces));
+ this._updateWorkspacesId = global.screen.connect('notify::n-workspaces', this._updateWorkspaces.bind(this));
this._overviewShownId =
Main.overview.connect('shown', () => {
this._switchWorkspaceNotifyId =
global.window_manager.connect('switch-workspace',
- Lang.bind(this, this._activeWorkspaceChanged));
+ this._activeWorkspaceChanged.bind(this));
},
_setReservedSlot(window) {
_init() {
this.actor = new DelegateFocusNavigator({ clip_to_allocation: true });
this.actor._delegate = this;
- this.actor.connect('notify::allocation', Lang.bind(this, this._updateWorkspacesActualGeometry));
- this.actor.connect('parent-set', Lang.bind(this, this._parentSet));
+ this.actor.connect('notify::allocation', this._updateWorkspacesActualGeometry.bind(this));
+ this.actor.connect('parent-set', this._parentSet.bind(this));
let clickAction = new Clutter.ClickAction();
clickAction.connect('clicked', action => {
this.actor.bind_property('mapped', clickAction, 'enabled', GObject.BindingFlags.SYNC_CREATE);
let panAction = new Clutter.PanAction({ threshold_trigger_edge: Clutter.GestureTriggerEdge.AFTER });
- panAction.connect('pan', Lang.bind(this, this._onPan));
+ panAction.connect('pan', this._onPan.bind(this));
panAction.connect('gesture-begin', () => {
if (this._workspacesOnlyOnPrimary) {
let event = Clutter.get_current_event();
this._settings = new Gio.Settings({ schema_id: OVERRIDE_SCHEMA });
this._settings.connect('changed::workspaces-only-on-primary',
- Lang.bind(this,
- this._workspacesOnlyOnPrimaryChanged));
+ this._workspacesOnlyOnPrimaryChanged.bind(this));
this._workspacesOnlyOnPrimaryChanged();
this._switchWorkspaceNotifyId = 0;
this._restackedNotifyId =
Main.overview.connect('windows-restacked',
- Lang.bind(this, this._onRestacked));
+ this._onRestacked.bind(this));
if (this._scrollEventId == 0)
- this._scrollEventId = Main.overview.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
+ this._scrollEventId = Main.overview.connect('scroll-event', this._onScrollEvent.bind(this));
if (this._keyPressEventId == 0)
- this._keyPressEventId = global.stage.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
+ this._keyPressEventId = global.stage.connect('key-press-event', this._onKeyPressEvent.bind(this));
},
animateFromOverview(fadeOnPrimary) {
else
view = new WorkspacesView(i);
- view.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
+ view.actor.connect('scroll-event', this._onScrollEvent.bind(this));
if (i == this._primaryIndex) {
this._scrollAdjustment = view.scrollAdjustment;
this._scrollAdjustment.connect('notify::value',
- Lang.bind(this, this._scrollValueChanged));
+ this._scrollValueChanged.bind(this));
}
this._workspacesViews.push(view);
global.init_xdnd();
var dnd = Meta.get_backend().get_dnd();
- dnd.connect('dnd-enter', Lang.bind(this, this._onEnter));
- dnd.connect('dnd-position-change', Lang.bind(this, this._onPositionChanged));
- dnd.connect('dnd-leave', Lang.bind(this, this._onLeave));
+ dnd.connect('dnd-enter', this._onEnter.bind(this));
+ dnd.connect('dnd-position-change', this._onPositionChanged.bind(this));
+ dnd.connect('dnd-leave', this._onLeave.bind(this));
this._windowGroupVisibilityHandlerId = 0;
},
_onEnter() {
this._windowGroupVisibilityHandlerId =
global.window_group.connect('notify::visible',
- Lang.bind(this, this._onWindowGroupVisibilityChanged));
+ this._onWindowGroupVisibilityChanged.bind(this));
this.emit('drag-begin', global.get_current_time());
},
FlowedBoxes.prototype = {
_init() {
this.actor = new Shell.GenericContainer();
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocate));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocate.bind(this));
for (let i = 0; i < BOX_WIDTHS.length; i++) {
let child = new St.Bin({ width: BOX_WIDTHS[i], height: BOX_HEIGHT,
_init() {
this.actor = new Shell.GenericContainer();
- this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
- this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
- this.actor.connect('allocate', Lang.bind(this, this._allocate));
+ this.actor.connect('get-preferred-width', this._getPreferredWidth.bind(this));
+ this.actor.connect('get-preferred-height', this._getPreferredHeight.bind(this));
+ this.actor.connect('allocate', this._allocate.bind(this));
this.minWidthLine = new St.Bin({ style: 'background: red' });
this.actor.add_actor(this.minWidthLine);
this.handle = new St.Bin({ style: 'background: yellow; border: 1px solid black;',
reactive: true });
- this.handle.connect('button-press-event', Lang.bind(this, this._handlePressed));
- this.handle.connect('button-release-event', Lang.bind(this, this._handleReleased));
- this.handle.connect('motion-event', Lang.bind(this, this._handleMotion));
+ this.handle.connect('button-press-event', this._handlePressed.bind(this));
+ this.handle.connect('button-release-event', this._handleReleased.bind(this));
+ this.handle.connect('motion-event', this._handleMotion.bind(this));
this.actor.add_actor(this.handle);
this._inDrag = false;